Re: Inserting duplex and tumble options in cairo postscript output
Dov Grobgeld <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CA++fsGFTE5CMBWyZxQgXgsO+_SttRxB=NrD2XrmXd+LLtmAHCw@mail.gmail.com> |
Thanks! This is what I was looking for. You indeed uncovered me having been sleeping in a cave for the last 20 years. ;-) Dov On Thu, Aug 20, 2015 at 12:50 AM, Adrian Johnson <[email protected]> wrote: > On 19/08/15 22:41, Dov Grobgeld wrote: > > I have recently ported my line printing program paps > > (http;//github.com/dov/paps <http://github.com/dov/paps>) from my own > > postscript generation to using cairo. One of the things I wonder is how > > to insert tumble and duplex instructions in the generated postscript. > > The postscript for duplex and tumple typically look as follows: > > > > statusdict /setduplexmode known > > { statusdict begin setduplexmode end } {pop} ifelse > > statusdict /settumble known > > { statusdict begin settumble end } {pop} ifelse > > > > I suppose that I could add these statements through > > > > cairo_ps_surface_dsc_comment() > > > > but this looks quite ugly, as these statements are not dsc comments. So > > is there another method? > > The DSC comment functions are used for selecting printer features. eg > > cairo_ps_surface_dsc_comment(surface, "%%IncludeFeature: *Duplex > DuplexNoTumble"); > > CUPS will replace this with the PostScript code to enable duplex > extracted from the printer PPD. > > An example of enabling duplex can be seen in the pdftocairo code: > > http://cgit.freedesktop.org/poppler/poppler/tree/utils/pdftocairo.cc > > > > > > Regards, > > Dov > > > > > > > > -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo