Originally reported by: nobody@users.sourceforge.net This problem really stems from Acrobat. Acrobat determines the page orientation to display based on the dominant text orientation on the page. Unfortunately many of my pages have graphs, and the text has both orientations, and so the graphs randomly display as portrait (wrong) or landscape(right). I need a way to explicitly force the display orientation of each page. simon@rakon.co.nz
Comment originally by ghostgum@users.sourceforge.net Logged In: YES user_id=20387 The first thing is that Acrobat Reader uses the orientation specified in the PDF file. If nothing is specified, it uses Portratit. Any auto-rotation of pages is done by the application which generated the PDF. See the Acrobat Distiller parameters. For example -dAutoRotatePages=/None or /All or /PageByPage. To rotate an individual page, try adding the DSC comment %%PageOrientation: Landscape %%PageOrientation: Portrait just after the %%Page: line. This may force the orientation, but there is an issue over whether the auto sensing or DSC comments have priority. I think there is some other code you can use to specify the page orientation (e.g. pdfmark), but I can't find the details.
Comment originally by ghostgum@users.sourceforge.net Logged In: YES user_id=20387 The other method is to explicitly set the orientation with setpagedevice: << /Orientation 3 >> setpagedevice Valid values are 0 (portrait), 3 (landscape), 2 (upside down) and 1 (seascape).
Comment originally by jackiem@users.sourceforge.net Logged In: YES user_id=206537 Need better docs for this. It is a common problem.
Created attachment 193 [details] patch Fix DSC parser (which doesn't help much) and document existing behavior. IMHO every file can be committed separately because they all fix independent problems. For gdevpdfp.c Fix mis-identificaion of every DSC-conforming file as EPS. For gs_pdfwr.ps Activate DSC parser only after all prologue files are read to prevent spurious comments starting with '%%' disturbing the parser. For gs_stres.ps Use single '%' in the comment. For Ps2pdf.htm Add a paragraph documenting current page orientation options.
Thanks for tackling this. Some comments: In the docs we default to the unix convention of command line options. i.e. is should be -dAutoRotatePages=/None. The need to substitute '#' on windows is documented in Use.htm; if you want to mention it again here that's fine. Documenting the current behavior is certainly a step in the right direction, but it doesn't really answer the question posed by the bug, "How do I force a particular page orientation?" I think that's needed to consider the bug resolved. For example, the setpagedevice example helps if you know Ghostscript, but isn't of any utility with the ps2pdf script itself. Unfortunately, as coded it doesn't doesn't even let you say -c '<< /Orientation 3 >> setpagedevice' and I didn't find any quoting magic that would pass the option through cleanly. Perhaps we need a -dOrientation=? option added to ghostscript for this. In any case maybe the answer is "you can't". If so, the docs should state this definitively, but taking the time to convince myself that was true is why this bug is bountiable in the first place. :)
The patch to ps2pdf.htm and the patches to DSC handling code are committed to HEAD branch.
*** Bug 688081 has been marked as a duplicate of this bug. ***