<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks! This is what I was looking for. You indeed uncovered me having been sleeping in a cave for the last 20 years. ;-)<br></div><div class="gmail_extra"><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dov</div><br><div class="gmail_quote">On Thu, Aug 20, 2015 at 12:50 AM, Adrian Johnson <span dir="ltr"><<a href="mailto:ajohnson@redneon.com" target="_blank">ajohnson@redneon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 19/08/15 22:41, Dov Grobgeld wrote:<br>
> I have recently ported my line printing program paps<br>
</span>> (http;//<a href="http://github.com/dov/paps" rel="noreferrer" target="_blank">github.com/dov/paps</a> <<a href="http://github.com/dov/paps" rel="noreferrer" target="_blank">http://github.com/dov/paps</a>>) from my own<br>
<span class="">> postscript generation to using cairo. One of the things I wonder is how<br>
> to insert tumble and duplex instructions in the generated postscript.<br>
> The postscript for duplex and tumple typically look as follows:<br>
><br>
> statusdict /setduplexmode known<br>
> { statusdict begin setduplexmode end } {pop} ifelse<br>
> statusdict /settumble known<br>
> { statusdict begin settumble end } {pop} ifelse<br>
><br>
> I suppose that I could add these statements through<br>
><br>
> cairo_ps_surface_dsc_comment()<br>
><br>
> but this looks quite ugly, as these statements are not dsc comments. So<br>
> is there another method?<br>
<br>
</span>The DSC comment functions are used for selecting printer features. eg<br>
<br>
cairo_ps_surface_dsc_comment(surface, "%%IncludeFeature: *Duplex<br>
DuplexNoTumble");<br>
<br>
CUPS will replace this with the PostScript code to enable duplex<br>
extracted from the printer PPD.<br>
<br>
An example of enabling duplex can be seen in the pdftocairo code:<br>
<br>
<a href="http://cgit.freedesktop.org/poppler/poppler/tree/utils/pdftocairo.cc" rel="noreferrer" target="_blank">http://cgit.freedesktop.org/poppler/poppler/tree/utils/pdftocairo.cc</a><br>
<br>
<br>
><br>
> Regards,<br>
> Dov<br>
><br>
><br>
><br>
<br>
</blockquote></div><br></div></div>