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

Martin Pahl bugzilla at pahlx.de
Wed Oct 21 00:48:11 PDT 2015


As I explained in my comment to patch on 2015-03-13

https://bugs.freedesktop.org/show_bug.cgi?id=87161

the implentation of the bounding box calculation in poppler is wrong:

"To my understanding PageBoundingBox should reflect the actual bounding box of 
all elements on a page. The PageBoundingBox written by poppler is the width 
and height of the elements on a page before they are scaled and translated and 
to fit the page. 

The code is in file poppler/PSOutputDev.cc. I changed the code to first 
calculate scaling and translation and then write the transformed 
PageBoundingBox. Because the calculation was done after writing the 
PageBoundingBox in the original code it was neccessary to reorganize the code 
a litte bit. That's the reason why this patch is a little bit longer. 

I'm not sure, if I understood all the transformation in the file. I did not 
change anything in the calculation. I only changed the calculation of the 
PageBoundingBox. But somebody who has more understanding to the code should 
have a careful look to it."

If you need any extra explaination to my code just ask me. There is nothing 
more I could offer. We are using the patch now for half a year on about 40 
workstations. The original poppler is not working for us because of the wrong 
bounding box calculation. 

Regards,

Martin Pahl



Am Dienstag, 20. Oktober 2015, 19:44:58 schrieb William Bader:
> The Adobe document  5001.DSC_Spec.pdf "PostScript Language Document
> Structuring Conventions Specification" Version 3.0, 25 September 1992, says
> on page 39 about the BoundingBox comment: "This comment specifies the
> bounding box that encloses all marks painted on all pages of a document.
> That is, it must be a “high water mark” in all directions for marks made on
> any page. The four arguments correspond to the lower left ( llx , lly ) and
> upper right corners ( urx , ury ) of the bounding box in the default user
> coordinate system (PostScript units)." and gives an example where the
> BoundingBox is the smallest rectangle that covers the PageBoundingBoxes of
> the pages in the document.
> 
> If you are worried about breaking things that depend on the current behavior
> of pdftops, would it work to add a command line option?  pdftops already
> has -origpagesize and -nocrop options. Regards,William
> 
> To: poppler at lists.freedesktop.org
> From: stefan.brandner at gmx.at
> Date: Tue, 20 Oct 2015 19:02:03 +0200
> Subject: [poppler] Printing of certain PDF files does not work with
> "fit-to-page" because of wrong BoundingBox values in the PostScript
> 
> 
> 
> 
> 
> 
> 
> 
>     I am using the patch now for several month and I can prove it is working
> fine. So if the code quality is ok for you Albert why not pushing it?
> 
> Regards
> Stefan Brandner
> 
> El Dijous, 7 de maig de 2015, a les 09:34:09, Martin Pahl va escriure:
> > Hi,
> > 
> > I sent patches to fix the bug:
> > 
> > https://bugs.freedesktop.org/show_bug.cgi?id=87161
> > 
> > Those patches were automatically sent to poppler-bugs mailing list. But as
> > I see no reaction to my patch submission (poppler-bugs seems to be a
> > mailinglist without human interaction)  I just want to ask, what is the
> > right way to submit patches.
> 
> It is.
> 
> What we need is more people with time to review patches.
> 
> Cheers,
>   Albert
> 
> > By the way this bug is really annoying as it makes all PDF viewers using
> > poppler useless for printing documents that do not have the page size of
> > the output device (e.g. printer). On the other hand acroread is not an
> > alternative anymore as Adobe has discontinued support for Linux.
> > 
> > Regards,
> > 
> > Martin Pahl
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler



More information about the poppler mailing list