2011年3月14日 星期一

[Tips] Remove a PDF File Password in Ubuntu

1.pdftk - A handy tool for manipulating PDF file.
2.qpdf - The qpdf program is used to convert one PDF file to another equivalent PDF file.
3.xpdf-utils - Portable Document Format (PDF) suite -- utilities such as pdftops and ps2pdf.

1.pdftk:
download
$ sudo apt-get install pdftk
decrypt
$ pdftk input.pdf output output.pdf user_pw YOURPASSWORD-HERE
OR
$ pdftk input.pdf output output.pdf user_pw YOURPASSWORD-HERE owner_pw YOURPASSWORD-HERE
OR
$ pdftk input.pdf output output.pdf input_pw YOURPASSWORD-HERE
WHERE
input_pw password : Input PDF owner passwords
user_pw password : Input PDF user passwords
owner_pw password : Input PDF owner passwords same as input_pw.

2.qpdf:
download
$ sudo apt-get install qpdf
decrypt
$ qpdf --password=YOURPASSWORD-HERE --decrypt input.pdf output.pdf

3.xpdf-utils:
$ sudo apt-get install xpdf-utils
decrypt and create a postscript file
$ pdftops -upw YOURPASSWORD-HERE input.pdf
convert postscript to PDF
$ ps2pdf input.ps

reference: HowTo: Linux Remove a PDF File Password Using Command Line Options

沒有留言: