[cups.development] Filters and rotation

Tim Waugh twaugh at redhat.com
Fri Apr 1 07:07:07 PDT 2011


On Fri, 2011-04-01 at 15:33 +0200, Johannes Meixner wrote:
> As far as I know foomatic-rip does not at all generate raster output.
> It only builds a command line call for Ghostscript according to
> the values for the "FoomaticRIP" keywords from the PPD file
> and then it calls Ghostscript to generate the raster output.

I know how foomatic-rip works. :-)  The fact remains: PostScript (or
PDF) goes in, and raster data comes out.  At some point during this
process, foomatic-rip (viewed as a black box) needs to rotate landscape
documents as needed, just like pstoraster does.  Where during the
foomatic-rip process this should happen, and how, I'm not sure.

> But as far as I know Ghostscript ignores DSC comments so that
> Ghostscript's raster output only depends on the actual PostScript.

Yes, which is why my suspicion is that foomatic-rip will need to insert
translate/rotate commands at the appropriate points in the PostScript
file (like pstops does when rotating).

If anyone has a better plan, feel free to jump in... ;-)

> If you can get the actual PostScript which Ghostscript gets as input
> as a file (e.g. gs-input.ps) run Ghostscript with its "bbox" device
> (e.g. "gs -sDEVICE=bbox gs-input.ps") to get the actual PostScript
> bounding box values which show if the actual PostScript has
> landscape dimensions (i.e. if it is wider than high).

I don't think you're suggesting that foomatic should do this as a matter
of course.  The PostScript that foomatic-rip gives to gs is in the wrong
orientation when you print a landscape PDF.  The bounding box isn't very
good for detecting that though.  Here's what I get, for example, with a
simple test document:

%%BoundingBox: 57 524 176 536
%%HiResBoundingBox: 57.023998 524.501984 175.607995 535.445984

If I run 'gs -sDEVICE=x11' on the PostScript then I see a landscape
document, just like the one that entered the filter chain originally.
More damningly, the PXL printer prints it the wrong way around and
complains about being given an invalid media size.

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.cups.org/pipermail/cups-devel/attachments/20110401/f2cdaf23/attachment.sig>


More information about the cups-devel mailing list