Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I have a PDF and I have its password, I can merely send it to a PDF printer to get a new PDF with the same contents and no password. The process is not exactly painless though (Ubuntu's inbuilt PDF printer, for example, doesn't seem too interested in honoring my page orientation settings; PDFCreator for Windows merely looked at me funny and printed an error message, etc.)

I'd like to make this process a little less painful and I imagine ImageMagick could come to my help. However...

convert foo.pdf -authenticate baz bar.pdf

...doesn't give me joy.

   **** This file requires a password for access.
   **** The file was produced by: 
   **** >>>> �Sh�Ў,bd�  a���߰�
                                �u�|!
                                      ���� <<<<
Error: /invalidfileaccess in pdf_process_Encrypt

Now... I guess that if there's pdf_process_Encrypt, chances are there's also support for a pdf_process_Decrypt operation, right?

How can I do this then?

share|improve this question
1  
Wouldn't this be a lot easier? –  Flimzy May 6 '12 at 17:41
    
@Flimzy None of those options appeal to me, to be honest... They're all various shades of unnecessarily shady. –  badp May 6 '12 at 17:46
1  
Heh... And password-circumvention isn't already shady? The phrase "honest thief" comes to mind :) –  Flimzy May 6 '12 at 17:47
    
@Flimzy uh? I have the password already. I didn't need to crack it or anything. There's absolutely no "thievery" involved here. –  badp May 6 '12 at 17:48
    
I'm not really accusing you of being a thief. I just think it's funny to be picky about how to remove a password (whether for honest purposes or not). Anyway, I don't have enough knowledge to answer your question directly. Good luck. –  Flimzy May 6 '12 at 17:49

2 Answers 2

This can be done very simply using ImageMagick though I only found it through trial and error. The command that I use to remove restrictions from PD's is:

mogrify c:\workingdirectory\password_protected.pdf

Basically it will cause ImageMagick to recreate the PDF exactly the way it is, but since ImageMagick is unable to add restrictions the result is the same PDF without restrictions. Let me know if you have any issues and I can send you an example of the script I use for it.

share|improve this answer

pdftk may help:

pdftk secured.pdf input_pw foopass output unsecured.pdf

On Windows, A-PDF Restrictions Remover is also good, although payware.

share|improve this answer
    
Thank you for your answer, but it probably belongs on this other question rather than this one. Although I have the growing suspicion that the command in my question would work fine, it's just the encryption scheme that most PDF libraries fail to actually support. Poke me if you do move your answer over there; I'll bounty you 100 for the trouble :) –  badp May 6 '12 at 18:25

protected by Community Oct 23 '12 at 6:31

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.