[gs-devel] PS2Jpeg in Landscape xefitra

Ray Johnston Ray.Johnston at Artifex.com
Fri Apr 25 18:15:16 PDT 2008


Hi Peter,

The '-dAutoRotatePages' option is only relevant to the 'pdfwrite' device (it
is described in Ps2pdf.htm). This is an Adobe distillerparam parameter and
is ignored by Ghostscript in general.

Ghostscript follows the PLRM (Adobe's PostScript Language Reference Manual
 3rd edition), and the only 'suto-rotation' is provided by the 
'setpagedevice'
implementation which will rotate _IF NEEDED_ to find a match between the
requested PageSize and those available in the various 'slots' in the
'InputAttributes' dictionary.

Ghostscript implements an extended form of the 'setpagedevice' 
InputAttributes
parameters to support variable page sizes. This is set up in the 
lib/gs_setpd.ps
file with the entry:

      mark /PageSize [0 dup 16#7ffff dup] .dicttomark

which allows support of page widths and lengths up to 524287 points (up to
29127 inches). This is done intentionally to allow 'raster' format devices
to accept arbitrary page sizes/shapes.

Ghostscript also populates the InputAttributes dictionary with a LARGE 
variety
of page sizes. This is done in lib/gs_setpd.ps by:

    statusdict /.pagetypenames get {
      counttomark 1 sub 2 idiv exch mark exch /PageSize exch
      % stack: mark --dict-- --dict-- ... key mark /PageSize pagetypename
      % see note above about pagetype executable array contents.
      load dup 0 get exch 1 get 2 array astore .dicttomark
    } forall

If you want to support only a single page size, then remove or comment out
this latter section of PostScript code.

Then if all you have is a 'letter' size, and the request comes in for
PageSize [792 612] (landscape) Ghostscript will rotate.

If you wish to support a range of lengths, but limited width, then change
the 'range' to specify the maximum width and length you wish to support
(values in points == 1/72 inch). For example to support up to 8.5 inches 
wide
and 24 inch long faxes, use:

    mark /PageSize [ 0 0 612 1728 ] .dicttomark

To support only up to 'legal' length (14 inches) use:

    mark /PageSize [ 0 0 612 1008 ] .dicttomark

When Ghostscript gets a request for a page size that is wider than the 612
points (8.5 inches) it will rotate it automatically, setting the length of
the TIFF image to the requested width.

Note that Ghostscript (or any conforming PostScript setpagedevice 
implementation)
will also perform scaling of the page to 'best fit' and 'center' as 
described
in the 'Policies' section of Adobe's PLRM.

Regards,
Ray Johnston
------------------------------------------------------------------------

Peter Carlson wrote:
> I am using apple laserwriter print driver on windows to print a 
> powerpoint presentation (slides) to a file.
> then I run gswin32c like this:
> c:"\program files\gs\gs8.62\bin"\gswin32c -sDEVICE=jpeg -dNOPAUSE 
> -dBATCH -dSAFER -dAutoRotatePages=/All -r100 -sOutputFile=peter%d.jpg 
> output.ps
> or
> c:"\program files\gs\gs8.62\bin"\gswin32c -sDEVICE=jpeg -dNOPAUSE 
> -dBATCH -dSAFER -dNORANGEPAGESIZE -sPAPERSIZE=letter -r100 
> -sOutputFile=peter%d.jpg output.ps
> However the resulting jpegs are in portrait mode not landscape.
> 1.  Why isn't %%Orientation being used?
> 2.  How can I use gs to rotate?
>
> -----part of output.ps
> %-12345X at PJL JOB NAME = "Microsoft PowerPoint - Test Presentation.ppt"
> @PJL JOB
> @PJL ENTER LANGUAGE = POSTSCRIPT
> %!PS-Adobe-3.0
> %%Title: Microsoft PowerPoint - Test Presentation.ppt
> %%Creator: PScript5.dll Version 5.2.2
> %%CreationDate: 4/25/2008 17:21:45
> %%For: peter
> %%BoundingBox: (atend)
> %%Pages: (atend)
> %%Orientation: Landscape
> %%PageOrder: Special
> %%DocumentNeededResources: (atend)
> %%DocumentSuppliedResources: (atend)
> %%DocumentData: Clean7Bit
> %%TargetDevice: (Xerox Phaser 1235) (3011.103) 1
> %%LanguageLevel: 3
> %%EndComments
>
> %%BeginDefaults
> %%PageBoundingBox: 16 16 595 775
> %%ViewingOrientation: 0 -1 1 0
> %%EndDefaults
>
> Peter
> _______________________________________________
> gs-devel mailing list
> gs-devel at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ghostscript.com/pipermail/gs-devel/attachments/20080425/a8d35e19/attachment.htm


More information about the gs-devel mailing list