[gs-devel] ps2pdf and %%BoundingBox

Thomas Kaiser Thomas.Kaiser at phg-online.de
Fri Jul 4 07:51:50 PDT 2003


On Thu, 3 Jul 2003 19:15:14 -0600 (MDT), Nelson H. F. Beebe wrote:

> Has anyone given thought to support of an option in pdf2ps

ps2pdf?

> (i.e., ghostscript with -sDEVICE=pswrite) to allow the input %%BoundingBox
> to propagate automatically to any the PDF boxes that control image size?

There exists the -dEPSCrop option but in case you have to handle EPS files
that have a wrong bounding box (as a result of rounding or default paper
size or the like) you can also insert specific pdfmarks to force a correct
media box (using a HighResBoundingBox comment for example):

    /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
    [{ThisPage}<</MediaBox [ 30.5 403 558.3 700 ] >> /PUT pdfmark

(Have a look at <http://www.pdflib.com/more/pdfmark.html> and the PDF
documentation for more details about pdfmarks)

BTW: Does anyone have a clue whether I can use GS to extract both Media- and
TrimBox from _PDF_ files?

Regards,

Thomas




More information about the gs-devel mailing list