THBPdf Download Contact Us Buy Online Developerse-mail me

pdftk can t open pdf file




Message-ID:<gnr2sr$5lv$1@news.motzarella.org>
Subject:

pdftk can't open pdf file


Date:Sun, 22 Feb 2009 09:37:46 +0100


I've been using pdftk from the command line to remove the password 
protection on some pdfs, just to stop kpdf from asking for the password 
every time I want to open it.  And this works fine.  Now I've been given 
some different pdfs, also password protected, but my pdftk trick doesn't 
work here, it just says this:
pdftk blah.pdf input_pw blah output blah2.pdf
Error: Failed to open PDF file:
    blah.pdf
Errors encountered.  No output created.
Done.  Input errors, so no output created.

Note that this ISN'T the same error it gives when I get the password 
wrong - on the files where this command works, if I get the password 
wrong it says "OWNER PASSWORD REQUIRED, but not given (or incorrect)" - 
so that isn't the problem with these files.  And as I said I can open 
the pdf in kpdf without problems, so I know the password is correct.

I also tried pdf2ps, but just got an "unrecoverable error":
pdf2ps -sPDFPassword=blah blah.pdf
Error: /ioerror in --.reusablestreamdecode--
Additional information: (\2113B\267\\'\006\b|'\006\b\fW\005\b\370\002)
Operand stack:
... and then a load of other stuff from the internals of ghostscript?

I saw a report where pdftk has a problem with umlauts in the filenames, 
but this isn't the case here - I really did rename it to blah.pdf and 
there are no funny characters in the path.

System: Mandriva linux, pdftk 1.41

Any clues?  Thanks!




Message-ID:<49A1186A.8030405@nospam.lowagie.com>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 10:18:34 +0100


firsttimelinux wrote:
> I've been using pdftk from the command line to remove the password 
> protection on some pdfs, just to stop kpdf from asking for the password 
> every time I want to open it.  And this works fine.  Now I've been given 
> some different pdfs, also password protected, but my pdftk trick doesn't 
> work here, it just says this:
> pdftk blah.pdf input_pw blah output blah2.pdf
> Error: Failed to open PDF file:
>    blah.pdf
> Errors encountered.  No output created.
> Done.  Input errors, so no output created.
> 
> Note that this ISN'T the same error it gives when I get the password 
> wrong - on the files where this command works, if I get the password 
> wrong it says "OWNER PASSWORD REQUIRED, but not given (or incorrect)" - 
> so that isn't the problem with these files.  And as I said I can open 
> the pdf in kpdf without problems, so I know the password is correct.

You (should) know that Pdftk is nothing more than a very old version of 
iText (a Java-PDF library) compiled with GCJ and extended with some 
command line functionality.

The keywords in the above statement are "VERY OLD". The iText version 
that was used to create Pdftk only supported standard encryption 
(Alleged RC4); it didn't support AES encryption (yet).

Maybe the PDFs causing you trouble are encrypted using the AES 
algorithm. That would explain why you can open them with newer tools, 
but not with the (discontinued?) Pdftk tool.

Why do I think Pdftk is discontinued? The last thing I heard from Sid 
Steward (the developer responsible for Pdftk) is that he had inherited 
his father's business and that he wouldn't work on Pdftk anymore.
As Pdftk has a huge dependency on iText, all other companies who'd like 
to continue developing business using Pdftk should be in touch with 
iText Software LLC: http://itextsoftware.com/
And iText Software LLC has no business relationship with any other 
company with respect to Pdftk, so I assume there are no other companies 
working on Pdftk.




Message-ID:<gnrchu$mgc$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 12:22:37 +0100


Thanks for the reply!
Two more questions then - how do I check whether my files are encrypted 
with AES (to see whether that really is the problem) ?  And is there any 
other tool which _can_ deal with such pdfs, which can remove the 
password protection?


Bruno Lowagie wrote:
> ... The iText version 
> that was used to create Pdftk only supported standard encryption 
> (Alleged RC4); it didn't support AES encryption (yet).
> 
> Maybe the PDFs causing you trouble are encrypted using the AES 
> algorithm. That would explain why you can open them with newer tools, 
> but not with the (discontinued?) Pdftk tool.




Message-ID:<49a18f96$0$2864$ba620e4c@news.skynet.be>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 18:47:02 +0100


firsttimelinux wrote:
> Thanks for the reply!
> Two more questions then - how do I check whether my files are encrypted 
> with AES (to see whether that really is the problem) ?  And is there any 
> other tool which _can_ deal with such pdfs, which can remove the 
> password protection?

This is a copy paste of the encryption dictionary of a PDF encrypted 
with AES encryption:
<<
   /StrF/StdCF
   /CF <<
     /StdCF <<
       /CFM/AESV2
       /AuthEvent/DocOpen
       /Length 16
     >>
   >>
   /StmF/StdCF
   /U (xxxxxx)
   /O (xxxxxx)
 >>

This is an example of the encryption dictionary of a PDF encrypted with 
the Standard Encryption:
<<
   /Length 128
   /V 2
   /P -1852
   /Filter/Standard
   /R 3
   /U (xxxxxx)
   /O (xxxxxx)
 >>

Try finding the encryption dictionary in your PDFs.
Normally, you'll find a reference to the Encryption dictionary in the 
catalog (root) of the PDF. Something like this: /Encrypt 7 0 R




Message-ID:<gns7k3$3u2$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 20:04:34 +0100


It looks like you're right - I opened it up in KHexedit and searched for 
AES, and found this:
<</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>

But if I do the same with one of the pdfs which work, it doesn't contain 
AES at all.

So you're right, it looks like it is the AES causing the problem, now is 
there any other tool around which can handle these kinds of pdf?

Thanks!

Bruno Lowagie wrote:
> This is a copy paste of the encryption dictionary of a PDF encrypted 
> with AES encryption:
...




Message-ID:<49a258be$0$2855$ba620e4c@news.skynet.be>
Subject:

Re: pdftk can't open pdf file


Date:Mon, 23 Feb 2009 09:05:17 +0100


firsttimelinux wrote:
> It looks like you're right - I opened it up in KHexedit and searched for 
> AES, and found this:
> <</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>
> 
> But if I do the same with one of the pdfs which work, it doesn't contain 
> AES at all.
> 
> So you're right, it looks like it is the AES causing the problem, now is 
> there any other tool around which can handle these kinds of pdf?

Sorry, I only focus on iText and iText related products.
But you're probably not looking for a Java / C# solution.




Message-ID:<gnun1p$qm1$1@foggy.unx.sas.com>
Subject:

Re: pdftk can't open pdf file


Date:Mon, 23 Feb 2009 18:40:09 +0100


"firsttimelinux" <firsttimelinux@yahoo.com> wrote in message 
news:gns7k3$3u2$1@news.motzarella.org...
> It looks like you're right - I opened it up in KHexedit and searched for 
> AES, and found this:
> <</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>
>
> But if I do the same with one of the pdfs which work, it doesn't contain 
> AES at all.
>
> So you're right, it looks like it is the AES causing the problem, now is 
> there any other tool around which can handle these kinds of pdf?
>
> Thanks!
>
> Bruno Lowagie wrote:
>> This is a copy paste of the encryption dictionary of a PDF encrypted with 
>> AES encryption:
> ...

You might try multivalent:
http://multivalent.sourceforge.net/Tools/pdf/Decrypt.html

--Tim Arnold






Message-ID:<go0dgi$dtt$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file


Date:Tue, 24 Feb 2009 10:09:37 +0100


Thanks for the tip!

That Decrypt works for the ones which pdftk can handle, but fails for 
the AES ones with the message: "invalid OWNER password".  I hadn't quite 
appreciated the difference between the owner and user passwords before. 
  I know the password for kpdf so I can read it, but it looks like I 
don't know the owner password.

I also tried the "Merge" to join pdfs together (as I have done with 
pdftk) but that fails for both kinds of pdf.

Oh well. :/

Tim Arnold wrote:
> 
> You might try multivalent:
> http://multivalent.sourceforge.net/Tools/pdf/Decrypt.html
> 
> --Tim Arnold
> 




Message-ID:<5502a34f-4cf1-4f54-b443-aaf5ce862b95@41g2000yqf.googlegroups.com>
Subject:

Re: pdftk can't open pdf file


Date:Tue, 24 Feb 2009 09:44:48 +0100


Hi.

On Feb 22, 7:04=A0pm, firsttimelinux <firsttimeli...@yahoo.com> wrote:
> It looks like you're right - I opened it up in KHexedit and searched for
> AES, and found this:
> <</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>
>
> But if I do the same with one of the pdfs which work, it doesn't contain
> AES at all.
>
> So you're right, it looks like it is the AES causing the problem, now is
> there any other tool around which can handle these kinds of pdf?

Not free: http://www.coherentpdf.com/

cpdf in.pdf owner=3Dmypassword -o out.pdf

I normally recommend pdftk for free stuff, so I've not looked further
than that.

ghostscript should be able to do it, though, by specifying the output
device as PDF and giving the password on the command line. Try "man
gs".







Message-ID:<go0jk3$1am$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file (solved)


Date:Tue, 24 Feb 2009 11:53:55 +0100


Thanks!
I tried man gs but I couldn't find any way to enter the password - the 
command line just fails with "invalidfileaccess in pdf_process_Encrypt" 
without giving me a chance to enter the password - and there's no 
mention of passwords in the man page.

Anyway, fortunately I found the (or an) answer - and it was much easier 
than I thought!  I just opened the pdfs in kpdf, entered the password, 
and then printed them to a new pdf file.  Simple!
 From then on the new file is unprotected so I can use pdftk to merge 
them / whatever.

Problem solved! :)


John Whitington wrote:
> 
> Not free: http://www.coherentpdf.com/
> 
> cpdf in.pdf owner=mypassword -o out.pdf
> 
> I normally recommend pdftk for free stuff, so I've not looked further
> than that.
> 
> ghostscript should be able to do it, though, by specifying the output
> device as PDF and giving the password on the command line. Try "man
> gs".
>




Message-ID:<gnr2sr$5lv$1@news.motzarella.org>
Subject:

pdftk can't open pdf file


Date:Sun, 22 Feb 2009 09:37:46 +0100


I've been using pdftk from the command line to remove the password 
protection on some pdfs, just to stop kpdf from asking for the password 
every time I want to open it.  And this works fine.  Now I've been given 
some different pdfs, also password protected, but my pdftk trick doesn't 
work here, it just says this:
pdftk blah.pdf input_pw blah output blah2.pdf
Error: Failed to open PDF file:
    blah.pdf
Errors encountered.  No output created.
Done.  Input errors, so no output created.

Note that this ISN'T the same error it gives when I get the password 
wrong - on the files where this command works, if I get the password 
wrong it says "OWNER PASSWORD REQUIRED, but not given (or incorrect)" - 
so that isn't the problem with these files.  And as I said I can open 
the pdf in kpdf without problems, so I know the password is correct.

I also tried pdf2ps, but just got an "unrecoverable error":
pdf2ps -sPDFPassword=blah blah.pdf
Error: /ioerror in --.reusablestreamdecode--
Additional information: (\2113B\267\\'\006\b|'\006\b\fW\005\b\370\002)
Operand stack:
... and then a load of other stuff from the internals of ghostscript?

I saw a report where pdftk has a problem with umlauts in the filenames, 
but this isn't the case here - I really did rename it to blah.pdf and 
there are no funny characters in the path.

System: Mandriva linux, pdftk 1.41

Any clues?  Thanks!




Message-ID:<49A1186A.8030405@nospam.lowagie.com>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 10:18:34 +0100


firsttimelinux wrote:
> I've been using pdftk from the command line to remove the password 
> protection on some pdfs, just to stop kpdf from asking for the password 
> every time I want to open it.  And this works fine.  Now I've been given 
> some different pdfs, also password protected, but my pdftk trick doesn't 
> work here, it just says this:
> pdftk blah.pdf input_pw blah output blah2.pdf
> Error: Failed to open PDF file:
>    blah.pdf
> Errors encountered.  No output created.
> Done.  Input errors, so no output created.
> 
> Note that this ISN'T the same error it gives when I get the password 
> wrong - on the files where this command works, if I get the password 
> wrong it says "OWNER PASSWORD REQUIRED, but not given (or incorrect)" - 
> so that isn't the problem with these files.  And as I said I can open 
> the pdf in kpdf without problems, so I know the password is correct.

You (should) know that Pdftk is nothing more than a very old version of 
iText (a Java-PDF library) compiled with GCJ and extended with some 
command line functionality.

The keywords in the above statement are "VERY OLD". The iText version 
that was used to create Pdftk only supported standard encryption 
(Alleged RC4); it didn't support AES encryption (yet).

Maybe the PDFs causing you trouble are encrypted using the AES 
algorithm. That would explain why you can open them with newer tools, 
but not with the (discontinued?) Pdftk tool.

Why do I think Pdftk is discontinued? The last thing I heard from Sid 
Steward (the developer responsible for Pdftk) is that he had inherited 
his father's business and that he wouldn't work on Pdftk anymore.
As Pdftk has a huge dependency on iText, all other companies who'd like 
to continue developing business using Pdftk should be in touch with 
iText Software LLC: http://itextsoftware.com/
And iText Software LLC has no business relationship with any other 
company with respect to Pdftk, so I assume there are no other companies 
working on Pdftk.




Message-ID:<gnrchu$mgc$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 12:22:37 +0100


Thanks for the reply!
Two more questions then - how do I check whether my files are encrypted 
with AES (to see whether that really is the problem) ?  And is there any 
other tool which _can_ deal with such pdfs, which can remove the 
password protection?


Bruno Lowagie wrote:
> ... The iText version 
> that was used to create Pdftk only supported standard encryption 
> (Alleged RC4); it didn't support AES encryption (yet).
> 
> Maybe the PDFs causing you trouble are encrypted using the AES 
> algorithm. That would explain why you can open them with newer tools, 
> but not with the (discontinued?) Pdftk tool.




Message-ID:<49a18f96$0$2864$ba620e4c@news.skynet.be>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 18:47:02 +0100


firsttimelinux wrote:
> Thanks for the reply!
> Two more questions then - how do I check whether my files are encrypted 
> with AES (to see whether that really is the problem) ?  And is there any 
> other tool which _can_ deal with such pdfs, which can remove the 
> password protection?

This is a copy paste of the encryption dictionary of a PDF encrypted 
with AES encryption:
<<
   /StrF/StdCF
   /CF <<
     /StdCF <<
       /CFM/AESV2
       /AuthEvent/DocOpen
       /Length 16
     >>
   >>
   /StmF/StdCF
   /U (xxxxxx)
   /O (xxxxxx)
 >>

This is an example of the encryption dictionary of a PDF encrypted with 
the Standard Encryption:
<<
   /Length 128
   /V 2
   /P -1852
   /Filter/Standard
   /R 3
   /U (xxxxxx)
   /O (xxxxxx)
 >>

Try finding the encryption dictionary in your PDFs.
Normally, you'll find a reference to the Encryption dictionary in the 
catalog (root) of the PDF. Something like this: /Encrypt 7 0 R




Message-ID:<gns7k3$3u2$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file


Date:Sun, 22 Feb 2009 20:04:34 +0100


It looks like you're right - I opened it up in KHexedit and searched for 
AES, and found this:
<</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>

But if I do the same with one of the pdfs which work, it doesn't contain 
AES at all.

So you're right, it looks like it is the AES causing the problem, now is 
there any other tool around which can handle these kinds of pdf?

Thanks!

Bruno Lowagie wrote:
> This is a copy paste of the encryption dictionary of a PDF encrypted 
> with AES encryption:
...




Message-ID:<49a258be$0$2855$ba620e4c@news.skynet.be>
Subject:

Re: pdftk can't open pdf file


Date:Mon, 23 Feb 2009 09:05:17 +0100


firsttimelinux wrote:
> It looks like you're right - I opened it up in KHexedit and searched for 
> AES, and found this:
> <</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>
> 
> But if I do the same with one of the pdfs which work, it doesn't contain 
> AES at all.
> 
> So you're right, it looks like it is the AES causing the problem, now is 
> there any other tool around which can handle these kinds of pdf?

Sorry, I only focus on iText and iText related products.
But you're probably not looking for a Java / C# solution.




Message-ID:<gnun1p$qm1$1@foggy.unx.sas.com>
Subject:

Re: pdftk can't open pdf file


Date:Mon, 23 Feb 2009 18:40:09 +0100


"firsttimelinux" <firsttimelinux@yahoo.com> wrote in message 
news:gns7k3$3u2$1@news.motzarella.org...
> It looks like you're right - I opened it up in KHexedit and searched for 
> AES, and found this:
> <</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>
>
> But if I do the same with one of the pdfs which work, it doesn't contain 
> AES at all.
>
> So you're right, it looks like it is the AES causing the problem, now is 
> there any other tool around which can handle these kinds of pdf?
>
> Thanks!
>
> Bruno Lowagie wrote:
>> This is a copy paste of the encryption dictionary of a PDF encrypted with 
>> AES encryption:
> ...

You might try multivalent:
http://multivalent.sourceforge.net/Tools/pdf/Decrypt.html

--Tim Arnold






Message-ID:<go0dgi$dtt$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file


Date:Tue, 24 Feb 2009 10:09:37 +0100


Thanks for the tip!

That Decrypt works for the ones which pdftk can handle, but fails for 
the AES ones with the message: "invalid OWNER password".  I hadn't quite 
appreciated the difference between the owner and user passwords before. 
  I know the password for kpdf so I can read it, but it looks like I 
don't know the owner password.

I also tried the "Merge" to join pdfs together (as I have done with 
pdftk) but that fails for both kinds of pdf.

Oh well. :/

Tim Arnold wrote:
> 
> You might try multivalent:
> http://multivalent.sourceforge.net/Tools/pdf/Decrypt.html
> 
> --Tim Arnold
> 




Message-ID:<5502a34f-4cf1-4f54-b443-aaf5ce862b95@41g2000yqf.googlegroups.com>
Subject:

Re: pdftk can't open pdf file


Date:Tue, 24 Feb 2009 09:44:48 +0100


Hi.

On Feb 22, 7:04=A0pm, firsttimelinux <firsttimeli...@yahoo.com> wrote:
> It looks like you're right - I opened it up in KHexedit and searched for
> AES, and found this:
> <</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV2/Length 16>>
>
> But if I do the same with one of the pdfs which work, it doesn't contain
> AES at all.
>
> So you're right, it looks like it is the AES causing the problem, now is
> there any other tool around which can handle these kinds of pdf?

Not free: http://www.coherentpdf.com/

cpdf in.pdf owner=3Dmypassword -o out.pdf

I normally recommend pdftk for free stuff, so I've not looked further
than that.

ghostscript should be able to do it, though, by specifying the output
device as PDF and giving the password on the command line. Try "man
gs".







Message-ID:<go0jk3$1am$1@news.motzarella.org>
Subject:

Re: pdftk can't open pdf file (solved)


Date:Tue, 24 Feb 2009 11:53:55 +0100


Thanks!
I tried man gs but I couldn't find any way to enter the password - the 
command line just fails with "invalidfileaccess in pdf_process_Encrypt" 
without giving me a chance to enter the password - and there's no 
mention of passwords in the man page.

Anyway, fortunately I found the (or an) answer - and it was much easier 
than I thought!  I just opened the pdfs in kpdf, entered the password, 
and then printed them to a new pdf file.  Simple!
 From then on the new file is unprotected so I can use pdftk to merge 
them / whatever.

Problem solved! :)


John Whitington wrote:
> 
> Not free: http://www.coherentpdf.com/
> 
> cpdf in.pdf owner=mypassword -o out.pdf
> 
> I normally recommend pdftk for free stuff, so I've not looked further
> than that.
> 
> ghostscript should be able to do it, though, by specifying the output
> device as PDF and giving the password on the command line. Try "man
> gs".
>




 

|THBPdf| |Download| |Developers|