Remove password from PDF file

Sometimes, encrypted pdf file can be cumbersome. Especially in Mac OS X because default pdf viewer does not provide password decryption feature.

PDFLab does a good job in Mac OS X, but with the newest Snow Leopard, it does not work correctly. I still couldn’t find similar software as PDFLab.

Fortunately, in Linux box, you can easily remove password. To do this, your system should have installed ‘ghostscript’ and ‘poppler-utils’ packages. Following snippet is the simplified version of conversion script.

#!/bin/bash

filename=`basename $2 .pdf`
pdftops -upw $1 $filename.pdf
ps2pdf $filename.ps

First argument is password which is use to decrypt and second argument is the filename to convert.

Leave a Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.