Sunday, January 22, 2012

Unlocking PDFs

I was working with PDF files.  For purposes of reading them onscreen, I found it helpful to go into Adobe Acrobat and crop off most of the white space around the text.  This would allow Acrobat's page view to show the text in a larger size, making it easier to read.  I also sometimes liked to add bookmarks.  And for many PDFs, I would add a comment balloon on the first page, citing the URL, bibliographic information, or other indications of where the PDF came from, for future reference.

None of these things were possible when the creator of the PDF would password-protect it.  I was not sure why people would do that.  Most of them didn't, but there was the occasional exception.  Maybe they feared that someone would go in and change their wording.  I had never seen or heard of that, in my years of working with PDFs.  It did not seem like a realistic concern, for purposes of the kinds of PDFs that I was working with.  Its drawback was that it made it irritating, difficult, and for some purposes impossible to work with what they had written.

To get rid of the password, so that I could make adjustments like those described above, I did a search for appropriate freeware.  The first site that came up was an review of a handful of tools that were supposedly capable of unlocking PDF files.  Some of these programs could actually figure out what the original password was, though apparently that could take hours, days, or longer, depending on how complex the password was and what level of security was used.  It was evidently faster for a program to just break the password without trying to figure out what it was.

Among the tools listed in that review, I had long used Freeware PDF Unlocker.  Unfortunately, I was not able to install the version available at this point (1.0.4) in 64-bit Windows 7, even though the webpage said that I should have been able to do that.  The solution to that problem was to run it from within a Windows XP virtual machine (VM), created automatically by Windows Virtual PC.  Once I had installed Virtual PC, I had to go into it, open a Windows Explorer session (Start > Run > explorer), copy the Freeware PDF Unlocker installation program to Local Disk C, and install it from there.  I had to do that copying inside the VM because, of course, the virtual drive C used by Virtual PC did not actually exist on a hard drive:  it would not appear in Windows Explorer in Windows 7, outside of the VM. I had to install it from Local Disk C, inside the VM, because the VM would not install programs located on real drives.  Once it was installed, Freeware PDF Unlocker put an icon on the desktop in the VM.  I could then drag a passworded PDF from Windows Explorer, drop it on that icon, and get a PDF of the same name, with "_noPW" added at the end of the file's name.

Needless to say, it was a bit of a hassle to start a Windows XP VM, find the PDF in a Windows Explorer session inside the VM, and drag it over to the icon.  Freeware PDF Unlocker also was not able to unlock some PDFs with more advanced security, imposed by people who were desperate to insure that nobody would ever be able to change their words -- adding, perhaps, a faux testimonial about the author's positive experiences in having sex with animals.  I mean, that was certainly something to be worried about.  If I was going to continue with my work of inserting such comments into random PDFs, I was going to have to find a better PDF cracker.

The first relevant tool on the list was Guaranteed PDF Decrypter (GuaPDF for short).  I ran it on a PDF that Freeware PDF Unlocker hadn't been able to unlock.  GuaPDF gave me a message stating that it definitely could unlock the file, but unfortunately the file was too large for the free version, so I was going to have to buy the paid version.  That was a possibility, but I decided first to continue down the list.

The next option on that list was  This was an online service.  I had to upload my PDF and let them do their magic on it.  I then spent a minute or two watching the charming RevolverMaps image, on their webpage, that showed how people around the world were using FreeMyPDF at this very ... well, recently.  I didn't snap out of it until FreeMyPDF had downloaded the decrypted PDF back to me, a minute or two later.  Its print was a bit faded, compared to the original, but it looked like everything was there.  Acrobat wasn't able to OCR its pages until I first saved them as JPGs and then stitched them back together in Acrobat, producing a much larger file.  Then again, I didn't really need to OCR its pages.  They were already OCRed.  I did it just because the OCR process (or, in this case, reducing the gamma on the individual JPGs in IrvanView > File > Batch Conversion/Rename > Advanced, after first testing on a sample JPG in IrfanView with Shift-G) could sometimes improve the appearance of the text.

Anyway, FreeMyPDF had done the job, so that killed the incentive to look further down the list.  But if the incentive had been there, the next candidate would have been PDF Password Remover Online.  This appeared to be another upload-download option, though apparently (according to accommodating a smaller maximum PDF size.  Another option:  PdfCrypt, a command-line tool.  There were a couple of other tools on the webpage, but they seemed to be password retrievers and, as I say, would thus presumably be slower.



Just received a comment promoting a commercial PDF unlocker. I checked out its website. The Web of Trust addon for Firefox indicated that a number of people had given that website a bad rating. I wanted the commenter to know that I wasn't ignoring his/her comment, but that I moderate the comments for information that seems helpful.

Adobe Digital Rights

Hi all,

Nice blog! Unlock-PDF is a free service that enables you to unlock password-protected PDF files online. It removes any types of copy or print restrictions from password-protected secured PDFs. Thank you.


Great work ray that you have given some good ideas about PDF Unlocking. Currently I am using a great pdf unlocker and will use a new one.