Available languages

Useful links
Читать на русском

Friday, April 2, 2010

Mass printing... How to print locked pdf file.

Sometimes we have a problem: we have a pdf file with restricted printing. E.g.: we have made this file, have pushed the restrictions, but we've forgotten the password...
What can we do if we need to print it?
I use linux, now - almost the latest ubuntu (9.04). But the number of version is not the matter.
So. I have an option, how to solve our problem:
 

pdftoppm copy.pdf copy.ppm //each sheet of the pdf file will be saved in separate ppm file
convert *.ppm one.pdf //people guess that it works fine to unite many images in one pdf file, but I don't know exactly. If it works than it will use very much operative memory.  
for file in *.ppm; do ppmtojpeg $file > ${file/.ppm/.jpg}; rm $file; done //we want to convert all ppm files to jpg files
ls -d *.ppm | sed 's/\(.*\).ppm$/mv "&" "\1.jpg"/' | sh //we need to change the extensions of the files
convert *.jpg > one.pdf //you can also try it to unite your images in one pdf but I give no guarantees it works.
 
Really you can stop, when you have ppm files, if you can print them correctly/if you can store them, because they are much larger than such of jpg.
So you can print your locked pdf files.
I've done it on my laptop under Linux Mint 7 (Ubuntu 9.04).
Function convert comes in package ImageMagick.

No comments: