PS/PDF API Change Proposal: (Re: [cairo] Semantics of transparent objects)

Michael Sweet mike at
Wed Jan 18 07:41:59 PST 2006

Carl Worth wrote:
> On Wed, 18 Jan 2006 11:56:45 +0100, Alexander Larsson wrote:
>> I've totally ignored this thread, but I have another API question
>> regarding this API. This API does not allow you to write a PS file (i.e.
>> print) with different sizes on each page. This is something that for
>> instance OOo and word allows (page size, margins, landscape/portrait and
>> other page settings are per-page in these programs). Shouldn't we allow
>> this?
> Do printers handle documents like this? Do they prompt the user to
> load paper of a different size or automatically pull from different
> trays depending on the per-page size?

Yes! :)

This is all implementation/printer-specific, but suffice it to say
that CUPS requires that the printer (or the printer driver) support
per-page media and feature selection.  Most printers will simply
pull the media from the best source/tray, and if they don't see the
media they need they will either stop to ask for it or just print it
on the media they have.

In short, the PS/PDF API should support changing the page size on a
per-page basis, but I would also provide guidance WRT printing of
landscape pages - the app should rotate the CTM rather than choosing
a landscape page size to avoid unnecessary size changes.


Also, without knowing the details of the current Cairo APIs or
architecture (I've read enough to know we want to use it, but haven't
started coding with it), it might make sense to have the notion of
a PS/PDF "job" or "document" context, and then create surfaces that
are associated with that context which actually adds pages to it.

This architecture would also lend itself to the Windows print APIs
and device contexts, and would allow the app to provide the job
context with device-specific commands/job ticket data which is
passed on to the printing system and/or embedded in the output.

Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software

More information about the cairo mailing list