duplex printing problem (ps file)

Helge Blischke H.Blischke at srz-berlin.de
Tue May 25 05:17:30 PDT 2004


kazdan wrote:
> 
> Using cups 1.1.19 I am attempting to print a postscript file duplex
> "tumble" (flipping the page on the short side) -- but it does not
> work.
> 
> Although the printer is configured correctly (see output below from
>     lpoptions -p DuplexLandscape -l)
> when I attempt to print using _either_ of the commands:
>     math:~> lpr -P DuplexLandscape print.ps
>     math:~> lpr -P DuplexLandscape  -o sides=two-sided-short-edge print.ps
> it prints on only one side of the page.
> 
> Note, however, that if I convert the postscript file to pdf (using
> ps2pdf), then the page prints duplex correctly with the SAME command:
>     math:~> lpr -P DuplexLandscape print.pdf
> Also, if I print a simple text file duplex "tumble" it prints correctly.
> 
> In case it helps, below are more details on my operating system,
> version of cups, "lpoptions -l" output as well as the first 40 lines of
> the postscript file -- since I suspect that may be where the problem is.
> 
>      Any suggestions?
>         Jerry
> 
>                       ====================
> 
> Linux Mandrake 9.2  (kernel: 2.4.22-10md)
>                       ====================
> 
> cups installation from the following Mandrake 9.2 rpms:
>         cups-1.1.19-10mdk.i586.rpm
>         cups-common-1.1.19-10mdk.i586.rpm
>                       ====================
> math:~> lpoptions -p DuplexLandscape -l
> HPEconoMode/EconoMode: *PrinterDefault True False
> HPHalftone/Levels of Gray: *PrinterDefault Enhanced Standard
> Resolution/Printer Resolution: 1200x1200dpi 600x600x2dpi *600x600dpi 300x300dpi
> Smoothing/Resolution Enhancement: PrinterDefault *On Off
> Duplex/2-Sided Printing: None DuplexNoTumble *DuplexTumble
> PageSize/Media Size: Letter LetterSmall Executive Legal LegalSmall *A4 A4Small A5 A6 ISOB5 B5 w612h936 Postcard DoublePostcard w558h774 Env10 EnvMonarch EnvDL EnvC5 EnvISOB5 Custom
> InputSlot/Media Source: Upper Middle Lower Auto
> PageRegion/PageRegion: Letter LetterSmall Executive Legal LegalSmall A4 A4Small A5 A6 ISOB5 B5 w612h936 Postcard DoublePostcard w558h774 Env10 EnvMonarch EnvDL EnvC5 EnvISOB5
> ManualFeed/Tray 1 (Manual): True *False
> HPOption_Duplexer/Duplex Unit: *True False
> HPOption_PaperPolicy/Fit to Page: *PromptUser NearestSizeAdjust NearestSizeNoAdjust
> InstalledMemory/Total Printer Memory: *8MB 16MB 24MB 32MB 48MB 64MB
> HPOption_Tray3/Tray 3: *True False
> 
> -----------------------------------------------------------------------
> These are the first 40 lines of my postscript file "print.ps"
>                       ====================
> %!PS-Adobe-2.0
> %%Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software
> %%Title: japan.dvi
> %%Pages: 2 0
> %%PageOrder: Ascend
> %%BoundingBox: 0 0 596 842
> %%DocumentFonts: EURB10 CMR10 CMR12 CMSY10 CMTI12 CMCSC10 CMR8 CMR7
> %%+ CMMI12 CMMI8 CMSY8 MSBM10 CMR6 CMMI6 CMBX12 CMSL12 CMEX10 MSAM10
> %%+ CMMI10 CMSY7 CMSY6 CMMI7 CMSY5 MSBM7 CMTI10 CMBX10
> %%EndComments
> %%BeginProcSet: PStoPS 1 15
> userdict begin
> [/showpage/erasepage/copypage]{dup where{pop dup load
>  type/operatortype eq{1 array cvx dup 0 3 index cvx put
>  bind def}{pop}ifelse}{pop}ifelse}forall
> [/letter/legal/executivepage/a4/a4small/b5/com10envelope
>  /monarchenvelope/c5envelope/dlenvelope/lettersmall/note
>  /folio/quarto/a5]{dup where{dup wcheck{exch{}put}
>  {pop{}def}ifelse}{pop}ifelse}forall
> /setpagedevice {pop}bind 1 index where{dup wcheck{3 1 roll put}
>  {pop def}ifelse}{def}ifelse
> /PStoPSmatrix matrix currentmatrix def
> /PStoPSxform matrix def/PStoPSclip{clippath}def
> /defaultmatrix{PStoPSmatrix exch PStoPSxform exch concatmatrix}bind def
> /initmatrix{matrix defaultmatrix setmatrix}bind def
> /initclip[{matrix currentmatrix PStoPSmatrix setmatrix
>  [{currentpoint}stopped{$error/newerror false put{newpath}}
>  {/newpath cvx 3 1 roll/moveto cvx 4 array astore cvx}ifelse]
>  {[/newpath cvx{/moveto cvx}{/lineto cvx}
>  {/curveto cvx}{/closepath cvx}pathforall]cvx exch pop}
>  stopped{$error/errorname get/invalidaccess eq{cleartomark
>  $error/newerror false put cvx exec}{stop}ifelse}if}bind aload pop
>  /initclip dup load dup type dup/operatortype eq{pop exch pop}
>  {dup/arraytype eq exch/packedarraytype eq or
>   {dup xcheck{exch pop aload pop}{pop cvx}ifelse}
>   {pop cvx}ifelse}ifelse
>  {newpath PStoPSclip clip newpath exec setmatrix} bind aload pop]cvx def
> /initgraphics{initmatrix newpath initclip 1 setlinewidth
>  0 setlinecap 0 setlinejoin []0 setdash 0 setgray
>  10 setmiterlimit}bind def
> end
> %%EndProcSet
> %DVIPSWebPage: (www.radicaleye.com)
> %DVIPSCommandLine: dvips japan -o
> %DVIPSParameters: dpi=600, compressed
> %DVIPSSource:  TeX output 2004.05.22:1134
> %%BeginProcSet: texc.pro
> ..snip>...

Your prolog contains the PostScript statement
	/setpagedevice {pop} bind
which means tehe setpagedevice operator is made a no-op. Thus
(assuming your printer is at least level 2), your duplex option
will be ignored (for level 2 devices, it is a setpagedevice
statement).

Consult your TeX and dvips setup and modify accordingly.

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