Quantcast

Problem opening secured pdf file:

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem opening secured pdf file:

jDrinkard
This post was updated on .
Hello All,
I recently had a requirement to merge two pdf files, one is secure, the other is not, but for some reason it's not working.
What I'm doing is using a pdfReader as in:
String password = "xyzxyz";
byte[] ownerPassword = password.getBytes();
PdfReader pdfReader = newPdfReader(inputStream, ownerPassword);
but using this gives me a pdf header signature not found error.

I thought maybe the format was wrong for the bytes and tried password.getBytes("Cp1252"); and others,  but that wasn't it. In the ini file used by a script to create the file it has ownerPassword = "xyzxyz"
I'm using this password as an example.
Anyway I used
boolean result = pdfReader.isOpenedWithFulllPermissions(); and on the unsecure file I get, but for the secure file I get false, which I thought meant it has a user password, not an ownerPassword? I also use  pdfReader.isEncrypted(), which is true for the secure file.

The header is 1.4 and it's present with no garbage before it. I'm using iText 2.1.3. I've worked with iText before, but not with secure files and I'm not sure if this is the correct api or what I'm doing wrong?
Any ideas?

Thanks,
James

PS I also didn't mention that the document has restrictions on everything, except printing. Wouldn't that also be an issue as I don't have copying rights, which I think I need for merges, correct?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem opening secured pdf file:

wasegraves
Check your spelling, i.e.,

boolean result = pdfReader.isOpenedWithFulllPermissions();

Extra "l" in above.

Cheers,
Bill Segraves



----- Original Message ----
From: jDrinkard <[hidden email]>
To: [hidden email]
Sent: Fri, July 16, 2010 9:11:23 AM
Subject: [iText-questions] Problem opening secured pdf file:


Hello All,
I recently had a requirement to merge two pdf files, one is secure, the
other is not, but for some reason it's not working.
What I'm doing is using a pdfReader as in:
String password = "xyzxyz";
byte[] ownerPassword = password.getBytes();
PdfReader pdfReader = newPdfReader(inputStream, ownerPassword);
but using this gives me a pdf header signature not found error.

I thought maybe the format was wrong for the bytes and tried
password.getBytes("Cp1252"); and others,  but that wasn't it. In the ini
file used by a script to create the file it has ownerPassword = "xyzxyz"
I'm using this password as an example.
Anyway I used
boolean result = pdfReader.isOpenedWithFulllPermissions(); and on the
unsecure file I get, but for the secure file I get false, which I thought
meant it has a user password, not an ownerPassword? I also use
pdfReader.isEncrypted(), which is true for the secure file.

The header is 1.4 and it's present with no garbage before it. I'm using
iText 2.1.3. I've worked with iText before, but not with secure files and
I'm not sure if this is the correct api or what I'm doing wrong?
Any ideas?

Thanks,
James
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Problem-opening-secured-pdf-file-tp2291344p2291344.html

Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem opening secured pdf file:

jDrinkard
That isn't the code. I just did a typo in my email.

On Fri, Jul 16, 2010 at 8:54 AM, wasegraves [via iText - General] <[hidden email]> wrote:
Check your spelling, i.e.,

boolean result = pdfReader.isOpenedWithFulllPermissions();

Extra "l" in above.

Cheers,
Bill Segraves



----- Original Message ----
From: jDrinkard <[hidden email]>
To: [hidden email]
Sent: Fri, July 16, 2010 9:11:23 AM
Subject: [iText-questions] Problem opening secured pdf file:


Hello All,
I recently had a requirement to merge two pdf files, one is secure, the
other is not, but for some reason it's not working.
What I'm doing is using a pdfReader as in:
String password = "xyzxyz";
byte[] ownerPassword = password.getBytes();
PdfReader pdfReader = newPdfReader(inputStream, ownerPassword);
but using this gives me a pdf header signature not found error.

I thought maybe the format was wrong for the bytes and tried
password.getBytes("Cp1252"); and others,  but that wasn't it. In the ini
file used by a script to create the file it has ownerPassword = "xyzxyz"
I'm using this password as an example.
Anyway I used
boolean result = pdfReader.isOpenedWithFulllPermissions(); and on the
unsecure file I get, but for the secure file I get false, which I thought
meant it has a user password, not an ownerPassword? I also use
pdfReader.isEncrypted(), which is true for the secure file.

The header is 1.4 and it's present with no garbage before it. I'm using
iText 2.1.3. I've worked with iText before, but not with secure files and
I'm not sure if this is the correct api or what I'm doing wrong?
Any ideas?

Thanks,
James
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Problem-opening-secured-pdf-file-tp2291344p2291344.html

Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/



View message @ http://itext-general.2136553.n4.nabble.com/Problem-opening-secured-pdf-file-tp2291344p2291410.html
To unsubscribe from Problem opening secured pdf file:, click here.


Loading...