[cups.general] cups and pstops...

Johannes Meixner jsmeix at suse.de
Mon Jan 10 03:12:32 PST 2005


Hello,

Helge Blischke wrote (shortened):
> Wolfgang Wegner wrote (shortened):
> > 
> > However, I do have a problem printing booklets, made from PDF
> > files using pdftops and pstops, the command for generating the
> > postscript is: 'psbook | psnup -2 | pstops "2:0,1U(21cm,29.7cm)"'
> > 
> > The file prints, but is printed one-sided regardless of specifying
> > options like sides=two-sided-long-edge or Duplex=DuplexNoTumble

In general you should aviod the psutils and prefer the CUPS standard
filter options (but as far as I know for booklets you must still use
psutils because there is no appropriate CUPS standard filter option).


> There is nothing wrong with your CUPS installation (as far as I can
> see). The culprit is the pstops utility from the PSUtils package.
> It inserts a procset into the PS job just after the header comments
> which - among other tings - defines the setpagedevice
> operator as a noop. Thus, any defaults defined by your printer's
> PPD or given as options in the print command are just ignored.
> The only chance you'd have is with printers that need things like media
> size, duplexing or the like to be specified by PJL commands or with
> native IPP printers that natively support these attributes via the
> IPP interface.

I found out another workaround (when for example there are no
appropriate PJL commands).

Insert appropriate PostScript code snippets before the PostScript
which is produced by pstops:

Create two PostScript code snippet files duplexnotumble.ps
-----------------------------------------------------------
%!PS
statusdict /setduplexmode known
{statusdict begin true setduplexmode end} if {} pop
-----------------------------------------------------------
and duplextumble.ps:
-----------------------------------------------------------
%!PS
statusdict /setduplexmode known
{statusdict begin true setduplexmode end} if {} pop
statusdict /settumble known
{statusdict begin true settumble end} if {} pop
-----------------------------------------------------------

You may have to adapt the exact PostScript code snippets
according to your particular printer.

Send this files before the real printing data to activate duplex
without or with tumble like in the following examples:

  echo -e "1\f2\f3\f4\f5\f6\f7\f" \
  | a2ps -1 -o - \
  | psnup -4 \
  | cat duplexnotumble.ps - \
  | lp -d <queue>

to print 4 pages on one sheet with duplex

and

  echo -e "1\f2\f3\f4\f5\f6\f7\f" \
  | a2ps -1 -o - \
  | psnup -2 \
  | cat duplextumble.ps - \
  | lp -d <queue>

to print 2 pages per sheet with duplex and tumble.


Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5      Mail: jsmeix at suse.de
90409 Nuernberg, Germany                    WWW: http://www.suse.de/





More information about the cups mailing list