BoundingBox in PostScript output for A4 is too large and the co mputation with its comment are bogus

Zdenek Wagner zdenek.wagner at
Sun Mar 10 11:15:16 CET 2024

ne 10. 3. 2024 v 5:01 odesílatel Reinhard Kotucha
<reinhard.kotucha at> napsal:
> On 2024-03-10 at 00:47:58 +0100, Zdenek Wagner wrote:
>  > Hi,
>  >
>  > in fact, the BoundingBox comment is not crucial. It is used if EPS is
>  > included as graphics by a program which does not interpret the PS
>  > code. If you want to generate a file to be sent to a phototypesetter
>  > or to a proffesional printing machine, the boxes should be set in the
>  > PS/PDF code and the %%BoundingBox is irrelevant. If you want to print
>  > on A4 and the elements (photos, background) should touch the edge of
>  > the trimmed page, it should extend outside the final page dimensions
>  > because trimming is never pixel precise. You have to set TrimBox to
>  > the size of the page after trimming, BleedBox to the size where the
>  > material extends so that it goes till the edge of the trimed page, and
>  > MediaBox for crop marks and other information for the DTP studio. My
>  > zwpagelayout package does that.
> Hi Zdeněk,
> it's true that the BoundingBox is meaningless here except if you want
> to include a page in your document (maybe a poster) within a tight
> \fbox{}.  eps2pdf is using the BoundingBox it finds in order to
> determine an appropriate /MediaBox for the PDF file.
> But I think it's worthwhile to look into the code though.  The
> BoundingBox and the /PageSize argument of the setpagedevice dictionary
> should contain the same values.
>   %%BoundingBox: 0 0 596 842
>   << /PageSize [595 842] >> setpagedevice
> The /PageSize values are correct.  As far as I remember Tom added some
> code a few years ago in order to snap to the nearest known paper size.
> I told Karl that according to the PDF-spec the values of the /MediaBox
> shouldn't differ by more than 5bp from the standard values so that
> office printers can use this information to select an appropriate
> paper tray.  Karl forwarded my mail to Tom and Tom's response was
> quite positive.  I'm convinced that he implemented it and /page size
> is always correct .
> But I have one suggestion regarding the BoundingBox:
> I think that it's quite useful to provide a HiResBoundingBox commnent
> as well.  The latter allows real numbers instead of integers.  The
> real numbers are already available before they are rounded.  Hence not
> much work involved.  Maybe only an additional printf() call.
Hi Reinhard,

yes, dvips snaps to the nearest known paper size unless the specified
dimensions are too far. This functionality was there 30 years ago and
it can cause quite an expensive problem because typographers do not
prepare the files for office printers but for phototypesetters and the
format is not equal to any known paper size. Fortunatelly the snapping
can be switched off. Thus you can use the options depending on the use
case. HiResBoundingBox would be fine but for graphics inclusion you do
not need the declared page size but usually the tight bounding box.
You can obtain it by pdfcrop for PDF and epscrop for EPS.

> Regards,
>   Reinhard
> --
> ------------------------------------------------------------------
> Reinhard Kotucha                            Phone: +49-511-3373112
> Marschnerstr. 25
> D-30167 Hannover                    mailto:reinhard.kotucha at
> ------------------------------------------------------------------

More information about the tex-live mailing list.