Remove passwords from PDF files

Passwords on public PDF documents are a horrible idea. They are not effective, and they make legitimate uses harder. Encrypted PDFs even have a flag that can be used to discourage extraction for accessibility. Let’s not even consider the moral of that. Pdftk seems to have a problem processing some encrypted PDFs. I am not sure if this is due to lack of algorithmic support or due to other issues. In my case, the owner password had four letters and the user password was the empty string.

Read More…

Adding extra margin to a PDF

I wanted to add my own little margin notes to any PDF file (using LaTeX and the multistamp feature of PDFTk). However, because the PDF was arbitrary, I could not write on the existing margin. Instead, I had to add an extra margin at the side. But none of the standard tools supports that, and using pypdf and similar toolsets loses the metadata like bookmarks. Here is a quick hack to expand the relevant page boxes:

Read More…

All Posts by Category or Tags.