Protection Removed

I was working with some PDF files a little bit ago, trying to compile a bunch of state, federal, and in-house forms into one single PDF file. One form wouldn’t merge into the others because the creator (Yes you – NCDOR!) had locked the file for printing only. My first workaround was to print it through Adobe Distiller again and see if that removed the lock, but instead I was greeted with a message saying encrypted files cannot be Distilled again. Next, I tried printing it through trusty ol’ PDFCreator, but received a similar message, except it was in a PDF file instead of a text file. Nice touch. Insert eyeroll here.

My final attempt was to copy the file over to my laptop and try to find some Linux utility to remove the protection and then copy it back over. A few Google searches later, I hadn’t found anything, so I decided to think about that PDF tools I already had installed. The list looked like this:

pdf2dsc pdffonts pdfinfo pdftoppm pdftotext
pdf2ps pdfimages pdfopt pdftops

A few keystrokes later, I had my file unlocked:

jmoore@neo:~> pdfinfo locked-file.pdf
Creator: Adobe InDesign CS2 (4.0.2)
Producer: Adobe PDF Library 7.0
CreationDate: Tue 01 Aug 2006 02:37:56 PM EDT
ModDate: Thu 03 Aug 2006 03:03:55 PM EDT
Tagged: no
Pages: 2
Encrypted: yes (print:yes copy:yes change:no addNotes:no)
Page size: 612 x 792 pts (letter)
File size: 271471 bytes
Optimized: yes
PDF version: 1.6

jmoore@neo:~> pdf2ps locked-file.pdf
jmoore@neo:~> ps2pdf unlocked-file.pdf

jmoore@neo:~> pdfinfo unlocked-file.pdf
Creator: ESP Ghostscript 815 (pswrite)
Producer: ESP Ghostscript 8.15
CreationDate: Fri 03 Nov 2006 02:26:21 PM EST
ModDate: Fri 03 Nov 2006 02:26:21 PM EST
Tagged: no
Pages: 2
Encrypted: no
Page size: 612 x 792 pts (letter)
File size: 137722 bytes
Optimized: no
PDF version: 1.2

Copied it back over and Acrobat had no problems letting me merge it. Linux to the rescue again!