Stapling

John A. Murdie john at cs.york.ac.uk
Fri Oct 20 10:02:19 PDT 2006


I've tried:

$ lpr -o finishings=staple doc.pdf

on two printers which both have staplers and, in each case, no staple has been applied. (Our old printing system permits 'lpr -S' and that works fine.) The printers are an Oce 3165 and a Ricoh Aficio 3030PS. The apparently applicable parts of the PPD files are:

Oce 3165:
*OpenGroup: Finishing
*OpenUI *StapleWhen/Staple: PickOne
*OrderDependency: 55 AnySetup *StapleWhen
*DefaultStapleWhen: None
*StapleWhen EndOfSet/Staple: "
   1 dict dup /Staple 3 put setpagedevice"
*End
*StapleWhen None/No Staple: "
   1 dict dup /Staple 0 put setpagedevice"
*End
*?StapleWhen: "
 save
  5 dict begin
   /0 (None) def
   /1 (DeviceDeactivation) def
   /2 (EndOfJob) def
   /3 (EndOfSet) def
   /4 (EndOfPage) def
   currentpagedevice /Staple get
     {( ) cvs cvn load exec} stopped not{= flush}if
  end
 end restore"
*End

Ricoh Aficio 3030PS:
*OpenUI *StapleLocation/Staple: PickOne
*OrderDependency: 220 AnySetup *StapleLocation
*DefaultStapleLocation: None
*StapleLocation None/Off: "<< /Staple 0 >> setpagedevice"
*StapleLocation UpperLeft/Top left: "<<
  /Collate true  /CollateDetails <</Type 6 /AlignSet true>>
  /Staple 2  /StapleDetails << /Type 14 /Angle 0 /Position 0 >>
  >> setpagedevice"
*End
... elided
*?StapleLocation: "
  save
  /UK (Unknown) def
  {
    currentpagedevice dup /Staple 2 copy known not { UK exit } if
    get dup 0 eq {pop (None) exit }
    {pop /StapleDetails get dup /Position get
    dup 0 eq {pop (UpperLeft) exit} if
    dup 6 eq {pop (LowerLeft) exit} if
    dup 2 eq {pop (UpperRight) exit} if
    dup 4 eq {pop (LowerRight) exit} if
    dup 1 eq {pop (LeftW) exit} if
    dup 5 eq {pop (RightW) exit} if
    dup 7 eq {pop (UpperW) exit} if
    dup 3 eq {pop (LowerW) exit} if
    UK exit
    } ifelse
  } bind loop
  mark count 1 sub 2 roll cleartomark
  = flush
  restore
"
*End
*CloseUI: *StapleLocation

I've found STR #655 (and STR #1298, marked as a duplicate of #655) which says that the matter of finishing attributes are "Assigned for implementation in 1.3." and that until then numeric codes can be used. Is it possible to deduce from the above what options must be given to lpr in the case of each printer type to cause a printed document to be stapled?

John A. Murdie




More information about the cups mailing list