[cairo] Postscript and odd paper sizes...

James Cloos cloos at jhcloos.com
Tue Feb 9 13:56:57 PST 2010

>>>>> "R" == Rick Brownrigg <brownrig at ucar.edu> writes:

R> Some applications do not correctly recognize the page size in cairo-
R> generated postscript ...

R> Inspecting the postscript output reveals that the DSC comment
R> "%%BoundingBox" is properly set to reflect the page size.

R> However, ... the correct way to specify this is via ... setpagedevice

Indeed; the DSC comments are only their as hints to the print stream.

The idea was that the printstream would add a setpagedevice call before
sending the ps on to the RIP.

Given how postscript is used these days, it would be better for cairo to
include the setpagedevice call itself.  It should probably include a
Policies dict with a PageSize entry as well, probably with value 3.

It will need to output a setpagedevice call every time the paper size
changes w/in the docment.

OTOH, cairo probably should not set HWResolution unless specifically
asked to.  Setting that to sizes typical of printers can cause issues
when viewing the document to screen.  (GS's x11 device will honour the
HWResolution, which can lead to windows hughe enough to crash many

James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

More information about the cairo mailing list