Toying with using "qpdf" on PDFs...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Toying with using "qpdf" on PDFs...

sur-behoffski
G'day,

More on PDFs:  I'm slogging slowly towards having Tecgraf IM/CD/IUP
graphical tools available on GNU/Linux platforms that I use; part
of the effort in porting is contemplating a regression test rig.

Provided that a PDF is not encrypted, "qpdf" can unpack (undo zlib
compression) on a PDF, and is able to select page(s) to operate on.

Two identical runs of a short script that uses CD (Canvas Draw),
then draws some extremely simple primitives on it, and then saves it
as a PDF, result in a difference -- at least, there is a different
timestamp in the header.

Once qpdf has unpacked the PDF back into its PostScript text
format, the timestamp can be set to a nominal time (e.g. using a
simple text editing tool such as "sed", and the differences between
the PDFs becomes smaller.  [There's also what may be a checksum and
possibly an encryption/signature line at the end of the file; these
can also be text-edited to eliminate variance.]

This looks like a promising avenue for building a regression test
rig in the future; for now, there's too much groundwork/framework to
be laid first in order to release my "IM/CD/IUP Assistant", and so
things like "qpdf" have to remain on the back-burner for me at present.

However, this tool may be of interest as it can provide various ways of
manipulating PDFs, including splitting apart large files into smaller
chunks.

cheers,

sur-behoffski (Brenton Hoff)   (*NOT TO BE CONFUSED WITH "BIG SUR"*)
programmer, Grouse Software