[cups.development] Filters and rotation

Helge Blischke h.blischke at acm.org
Fri Apr 1 03:32:51 PDT 2011


Tim Waugh wrote:

> On Thu, 2011-03-31 at 10:20 -0700, Michael Sweet wrote:
>> pstoraster normally should get things in the right orientation. If we
>> see a landscape PageSize when the PPD defines a portrait orientation
>> for that size, we should be rotating the bitmap so that it is portrait
>> again (and I'm pretty sure that code is "in there").
> 
> Yes, pstoraster gets it right.
> 
>> What normally is the problem is that pdftops emits a landscape
>> setpagedevice command in the PostScript output, and then pstops
>> applies the corresponding portrait paper size command, leading to the
>> wrong orientation in the output.
> 
> What's going wrong (I think) in the tests I'm seeing is that the
> PostScript output is "portrait" output for landscape-sized media:
> 
> %%Page: 1 1
> %%PageBoundingBox: 0 0 842 595
> %%BeginPageSetup
> %%PageOrientation: Portrait
> 
IIRC, the notation or "Orientation" stems from the times of level 1 
PostScript interpreters for roll feed media and is specifically listed 
within the table specifying the page device parameters for roll feed media 
in the 3rd ed. of the PLRM.
As for the comment lines cited above, I think it is perfectly correct:
though the media has a "landscape geometry", the orientation of the page 
contents with respect to the media is portrait.
> (there is no setpagedevice command).  So when foomatic-rip generates
> raster output is does it line-by-line starting from a long edge, rather
> than from a short edge.
> 
>> The alternative is to make pdftops handle all of the CUPS options
>> (number-up, orientation-requested, fit-to-page, page-label, etc.)
>> along with the printer-specific commands such that it is producing
>> application/vnd.cups-postscript and not application/postscript (which
>> goes through pstops...)
> 
> Yes, when I get some time I need to work on that.
> 
> Thanks for your answer, that's clarified things a lot.
> 
> Tim.
> */

Helge





More information about the cups-devel mailing list