Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rasterize on Trimbox OR Cropbox with GhostScript

721 views
Skip to first unread message

Stefano

unread,
Feb 1, 2012, 4:16:33 AM2/1/12
to
Hi,

Is possible to define an alternative area to rasterize PDF?
Example: All PDF must have a TrimBox but in case the PDF don't have
this area I would like that GhostScript use as "alternative area" the
Cropbox.

Stefano

ken

unread,
Feb 1, 2012, 11:51:38 AM2/1/12
to
In article <c7f88c01-b380-4080-a9d3-bdac97f61781
@w4g2000vbc.googlegroups.com>, cappello...@gmail.com says...
-dUseCropBox

See /ghostpdl/gs/doc/Use.htm#PDF_switches


Ken

Stefano

unread,
Feb 2, 2012, 4:11:15 AM2/2/12
to
On 1 Feb, 17:51, ken <k...@spamcop.net> wrote:
> In article <c7f88c01-b380-4080-a9d3-bdac97f61781
> @w4g2000vbc.googlegroups.com>, cappello.stef...@gmail.com says...
>
> > Is possible to define an alternative area to rasterize PDF?
> > Example: All PDF must have a TrimBox but in case the PDF don't have
> > this area I would like that GhostScript use as "alternative area" the
> > Cropbox.
>
> -dUseCropBox
>
> See /ghostpdl/gs/doc/Use.htm#PDF_switches
>
>                 Ken


Hi Ken,

thanks for reply but what I mean is to instruct GS to get trim box
area and only if trim box area is not defined use crop area as are for
rasterize the PDF.
Rasterization priority is to TrimBox. If this is missing use CropBox.
Any suggestion?

Stefano

SaGS

unread,
Feb 2, 2012, 5:00:18 AM2/2/12
to
On Feb 2, 11:11 am, Stefano <cappello.stef...@gmail.com> wrote:
> ...
> what I mean is to instruct GS to get trim box area and only if trim
> box area is not defined use crop area as are for rasterize the PDF.
> ...

My reading of Ghostscript's Resource/Init/pdf_main.ps procedure
get_any_box is that if you specify both -dUseTrimBox and -dUseCropBox
on the command line, then GS will use the TrimBox if it exists, else
will use the CropBox. If none of the two are present, it will default
to the MediaBox.

I haven't tested it right now, and maybe more important the above
precedence is not explicitly stated so it may change in the future. If
that happens, at least now you know where to patch the code to get the
behavior you want :)
0 new messages