[poppler] Printing of certain PDF files does not work with "fit-to-page" because of wrong BoundingBox values in the PostScript

Stefan Brandner stefan.brandner at gmx.at
Sun Oct 25 03:38:09 PDT 2015


I want to summarize how the problem appears when printing the file
Dirichlet.pdf with okular.
Find the file at: https://bugzilla.opensuse.org/attachment.cgi?id=616147

1. with OpenSuse 13.1 and okular 4.11.2 the CUPS command was without the
fit-to-page option
following commands are executed:
pdftops Dirichlet.pdf
lpr Dirichlet.ps
The file was printed unscaled but centered and the printout was useful.

2. with the actual OpenSuse 13.2 and okular 4.14.9 the CUPS command is
now with fit-to-page and then the file is shifted to the right with half
of the text cut
this can be reproduced with following commands:
pdftops Dirichlet.pdf
lpr -o fit-to-page Dirichlet.ps
This does not work since the BoundingBox values are incorrect.
See explanation at CUPS documentation:
http://www.cups.org/documentation.php/options.html
------------------------------------------------------------------------------
Scaling to Fit

The -o fit-to-page option specifies that the document should be scaled
to fit on the page:

   lp -o fit-to-page filename
   lpr -o fit-to-page filename

The default is to use the size specified in the file.

This feature depends upon an accurate size in the print file.
If no size is given in the file, the page may be scaled incorrectly!
------------------------------------------------------------------------------

As mentioned in the opensuse bug:
https://bugzilla.opensuse.org/show_bug.cgi?id=908624
ghostscript shows Bounding Box values that do work.

Martin Pahl wrote a fix that calculates the correct page bounding values.
With this fix above commands work without problem.

3. another solution for the printing with okular would be calling
pdftotops -expand Dirichlet.pdf
lpr -o fit-to-page Dirichlet.ps

4. also a lpr Dirichlet.pdf from the command line is working but this it
is not the way as it is executed with okular

5. since it is not possible to disable the fit-to-page inside okular,
all printouts of files with wrong BoundingBox values are scrap!!!

6. the ideal place to fix this is may be somewhere else but the solution
from Martin fixes it for okular.

7. I had many files with this problems and since I am using the patch
all my printing problems are gone

Regards
Stefan



More information about the poppler mailing list