input tray selection - pdftops vs. ghostscript
Helge Blischke
H.Blischke at srz-berlin.de
Thu Jul 29 06:45:15 PDT 2004
Björn Pusch wrote:
>
> Michael Sweet wrote:
> > Björn Pusch wrote:
> > > Michael Sweet wrote:
> > >
> > >
> > >>How are you merging the resulting PS files?
> > >
> > > We just cut off the %EOF and concatenate them.
> >
> > Hmm, not the best way to handle it, as the %%Page: comments
> > will be out-of-whack and you'll have multiple prolog and
> > setup sections, which can confuse high-end printers.
> >
> > >>Since pdftops (as shipped in CUPS) does not send printer-specific
> > >>commands, how are you adding the printer-specific commands to the
> > >>final PS file?
> > >
> > > Which printer-specific commands do you mean?
> >
> > Anything that uses setpagedevice, basically. Normally the output
> > from the CUPS version of pdftops does not contain printer commands;
> > those are added by pstops prior to the file going to the backend.
> >
> > > Input tray selection in the ps file occurs as follows (for each
> > > document):
> > > %%BeginFeature: *InputSlot Optional
> > >
> > > currentpagedevice /InputAttributes get 5 get
> > > dup null eq
> > > { pop }
> > > { dup length 1 add dict copy
> > > dup /InputAttributes
> > > 1 dict dup /Priority [5] put
> > > put setpagedevice
> > > } ifelse
> > > %%EndFeature
> > >
> > > We tried this with the 3.0 version of xpdf as well as the built-in
> > > pdftops of cups 1.1.19.
> >
> > Are you working with the output of pdftops directly, or the output
> > from pstops in the filter chain?
>
> We concatenate the output of pstops and send it to a raw printer.
If you use xpdf's pdftops V 3.0, I'd suggest
(1) strip off the whole prolog (from the first - the "%!"-line) up to
and including the
%%EndProlog
line from all but the first file.
Retain the stuff between "%%BeginSetup" and "%EndSetup" as it
contains the used
font (subsets).
(2) at the end of each but the last file, delete the %%Trailer line but
retain the next
one containing "end", and delete from the next line to the end.
(3) for each page (easily identified by the "%%Page: n n" comment line),
insert
the reauired setpagedevice statement just before or after the line
which contains
only
pdfStartPage
(4) (optional) if you want to feed this through CUPS' filter chain,
renumber the pages
(the "n n" numbers in the "%%Page: n n" comment lines) to make the
pstops filter
happy.
Helge
--
H.Blischke at srz-berlin.de
H.Blischke at srz-berlin.com
H.Blischke at acm.org
More information about the cups
mailing list