Lately I’ve been digging around online to find old genre short stories written in the 19th and early 20th centuries. In many cases it’s clear that the works have passed into the public domain, at least here in the U.S., but in other cases there’s a questionable copyright claim, as when a modern publisher slaps a new copyright on what appears to be public domain, and you can’t find any evidence of said registration with the Copyright Office.
Whether such cases are due to idiocy or deliberate copyfraud, they hurt the consumer. It’s prohibitively expensive for the average private citizen to have to engage the Library of Congress as well as hire a copyright attorney (which, no kidding, is what the Copyright Office recommends) just to confirm that he has the right to do what he wants with something published in 1925. Even then, if the work was first published outside the U.S. then it may be nearly impossible to determine its true copyright status.
Which leads me to the problem of locked PDF versions of century-old works. I’m now in the possession of half a dozen PDFs of old short stories that various websites offer for free, and yet those files have been password protected to prevent me from printing, copying, or otherwise gaining direct access to the text. In the most extreme cases, the person who created the PDF file has, for reasons known only to him and the functionally retarded demon who guides him, added his own copyright claim to it. Seriously, people should just be hit with sticks sometimes.
Remove that PDF’s sham DRM with MuPDF!
(That may be the worst subheading ever written.)
Fortunately, Robert Brewer at Excited Curiosity explains that you can use a free open source PDF toolkit called MuPDF to unlock password protected PDF files. There are MuPDF viewers for Windows and Linux at MuPDF.com, but For OS X you have to use the command line (i.e., the Terminal app found under Applications>Utilities). Everything that follows is for OS X users.
First download the OS X binary from mupdf.com, unarchive it, and put the resulting folder wherever you like. Then in Terminal, use the “cd” command to navigate to that folder, and then run the “pdfclean” command on a locked file and in seconds, you’ll have a new unlocked version. Here’s an example of how to run the command if you have the MuPDF folder in your home directory and the locked PDF file on your Desktop:
./pdfclean ../Desktop/lockedfile.pdf ../Desktop/newnameforfile.pdf
If you’re not used to Terminal, here’s a quick introduction that will teach you the basics. Pretty much all you need to know to use MuPDF is how to type the full paths of the MuPDF folder and of the locked PDF file, and the command “cd” to change directories. (The command “ls” to list the contents of your current directory is also helpful.) You can also check out this comment on Brewer’s blog for more help.
Using OS X? Here’s a contextual menu shortcut for MuPDF
I was excited about finding this free solution to the bogus DRM problem, but I wanted an easier way to use it in the future without having to launch Terminal each time. I created a simple workflow service in Automator that I can access via the contextual menu when I click on a file. Now when I download a PDF and find that it’s locked, I simply right-click the document and select “UnlockPDF” from my Services menu, and a clean version appears next to the original.
Here’s the code I used to create the service. Note that I wrote this using Automator 2.2.1; when I shared a similar tip last year for KindleGen, I discovered that some readers couldn’t replicate my instructions because they were using older versions.
- Launch Automator and create a new Service workflow.
- At the top of the composition area, change “Service receives selected [dropdown]” to either “files or folders”, “folders”, or “PDF files”. Change the other dropdown to “Finder”.
- In the Library pane on the left, click the Utilities directory, then find the “Run Applescript” action and drag it into the composition area.
- Select all the default code in the “Run Applescript” box and delete it.
- Paste the above code in. Be sure to edit the path to the MuPDF folder so that it’s correct for your situation.
- Click the hammer icon to compile the code.
- Save the service under whatever name you like. I chose “UnlockPDF” to make it easy to find months from now when I’ve forgotten all about how I did this.
Because I’m a pretty bad scripter, I’m sure this isn’t the most elegant way to do this. If you can improve on it—particularly if you can fix it so that it can batch process an entire folder of PDF files—please let me know and I’ll update the script.