[gs-bugs] [Bug 692275] Support rendering a part (subrectangle) of a document

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Sun Jun 12 14:35:24 UTC 2011


http://bugs.ghostscript.com/show_bug.cgi?id=692275

Ray Johnston <ray.johnston at artifex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Ray Johnston <ray.johnston at artifex.com> 2011-06-12 14:35:23 UTC ---
If the document is an EPS file that has %%BoundingBox: comments, then
-dEPSCrop will do this automatically.

For general PostScript you can set the page size to a a width height using
-gWxH (where W and H are in pixels).

You can move the origin up to the interesting port part of the page by
using the 'translate' operator to move the graphics down.

If the 100,100 lower region in the example was in points (1/72 inch) and
the 400,500 is the upper right corner (also in points), then the origin
needs to be at (100*96/72=133.3333) assuming -r96 is being used for the png
and the page size in pixels will be 400 by 534 pixels (rounding 533.333 up)

thus this command line would be used:
gs -q -sDEVICE=png16m -r96 -g400x534 -dNOPLATFONTS -dTextAlphaBits=4 \
   -dGraphicsAlphaBits=4 -o /tmp/x.png \
   -c "<< /Install { -133.3333 dup translate } >> setpagedevice" x.ps

The magic "Install" procedure establishes the 'initgraphics' CTM for PS
and is standard PostScript straight out of the PLRM.

This isn't a bug, so closing as "FIXED" by this example.

Next time try asking someone on comp.lang.postscript or IRC #ghostscript or
stackoverflow.

-- 
Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gs-bugs mailing list