[Bug-gs] ps2pdf landscape lanscape page orientation rotating output

Helge Blischke H.Blischke@srz-berlin.de
Thu, 29 Nov 2001 17:42:11 +0100


Brian Eldridge wrote:
> 
> Helge Blischke wrote:
> 
> > Brian Eldridge wrote:
> > >
> > > Thanks for your response.... I'm not sure where the rest of my e-mail went, but
> > > I'll try again:
> > >
> > > Basically, I am using ps2pdf to convert an 80 page schematic file into pdf
> > > format using "AFPL Ghostscript 7.0 (2001-04-08)".
> > >
> > > Most pages rotate properly based on the text contained within them, but there
> > > are a few pages where there is more vertical text than horizontal text and as a
> > > result, the page rotation is off.  I've attached a sample page to illustrate
> > > what I mean.
> > >
> > > test.ps is the input file, and test.pdf is the resultant output file, but as you
> > > may see from the page border, I would prefer this page to be viewed on screen in
> > > landscape mode.  None of the options I could see would force the rotation
> > > I wanted in the output pdf file.
> > >
> > > Any additional help would be appreciated.
> > >
> > > Thanks
> > > -Brian
> > >
> > I've looked at your ps file. As it is not DSC compliant (and doesn't
> > contain any %%PageOrientation: xxx
> > comments), gs has no chance to rotate the page as intended.
> >
> > Your only chance is to edit the ps file and insert
> > ---snip---
> > [{ThisPage} <</Rotate 90>> /PUT pdfmark
> > ---snip---
> > just in front of the showpage operator (which is redefined as sh in yor
> > file, that means: put the
> > pdfmark just in fromt of the line containing only the sh .
> 
> Thanks again for the reply.  I tried what you suggested and it did not seem to do
> anything.  I've attached again the (edited) version of my .ps input file, but the
> output is the same as before (also attached again).
> 
> Are there any other command line options for ps2pdf or anything else I can try to
> insert into the .ps file itself to force this rotation?
> 
> For example, you mention a "%%PageOrientation: xxx" directive.  Althought the other
> 77 pages in my schematic seem to auto-rotate properly despite the lack of such a
> command (due to the amount of horizontal text), would it work if I post processed the
> .ps file to insert such a comand on the pages I need to force due to too much
> vertical text?  If so, can you explain the syntax of what I'd need to add insert in
> the .ps file?
> 
> Thanks again,
> -Brian

Well, there seems to be a conflict between the "/AutoRotatePages
/PageByPage" which is the
default in both distiller and ghostscript, and the explicitely defined
rotation.
In both cases, the page dictionary contains 2 (TWO) key-value-pairs
concerning rotation:

- distiller:
  /Rotate 90
  /Rotate 90

- ghostscript (7.00)
  /Rotate 180
  /Rotate 90

If you insert
---snip---
<</AutoRotatePages /None>>setdistillerparams
---snip---
near the beginning of the ps file, the desired rotation shows up, and
the page dict
contaions only 1 (ONE) rotation entry.

With gs, you may define this as a command line option
(-dAutoRotatePages=/None) as well,
but then you'll have to define the desired orientation whenever the
orientation changes.

It would be possigle to modify gs as to delete the rotation entry
produced by the auto rotation
feature if an explicit rotation is defined, but I'm not sure if it is
desirable to deviate
from distiller's behaviour in such a subtle way...

Helge
-- 
H.Blischke@srz-berlin.de
H.Blischke@srz-berlin.com
H.Blischke@acm.org