1.11 Malformed Files

There are many malformed PDF files in existence, including many produced by otherwise-reputable applications. cpdf attempts to correct these problems silently, but sometimes this can be very slow.

Grossly malformed files will be reconstructed. The reconstruction progress is shown on stderr (Standard Error):

./cpdf in.pdf -o out.pdf
couldn't lex object number
Attempting to reconstruct the malformed pdf in.pdf...
Read 5530 objects
Malformed PDF reconstruction succeeded!

Sometimes files can be technically well-formed but use inefficient PDF constructs. If you are sure the input files you are using are impeccably formed, the -fast option added to the command line (or, if using AND, to each section of the command line). This will use certain shortcuts which speed up processing, but would fail on badly-produced files.

The -fast option may be used with:

§3
-rotate-contents -upright -vflip -hflip
-shift -scale -scale-to-fit -scale-contents

§8
-add-text
-stamp-on -stamp-under -combine-pages

If problems occur, refrain from using -fast.