LZWDecode a PDF File

Today I wanted to dissect a PDF file. Running pdf2ps quickly showed some big lumps of binary data. Looking a bit closer I found out that it is run through the filters ASCII85Decode and LZWDecode. After failing to decode this myself I searched again on the net and found the following blog entry:

Converting a PDF to PS without the LZWDecode filter

So just run the following commands:

qpdf --stream-data=uncompress original.pdf decoded.pdf
pdftops decoded.pdf decoded.ps

Manipulate PDF Files

A while ago I wanted to remove some pages from a PDF file. I was searching for tools to do that, but I didn’t find a solution. A few weeks ago I stumbled upon this blog post: Merge multiple PDF files into one file. There G33kgrrl describes a few of pdftk‘s functions. But it has quite a lot more functions. Read the manual to see what else it can do.

I hope I will remember this blog entry the next time I have to manipulate a PDF file ;)