Soc ninja title

Printing and stapling multiple copies properly

Printing and stapling multiple copies properly with a HP M604dn under CUPS

A common problem with those using CUPS with printers that have stapling capabilities is that, when trying to print and staple multiple copies of a document, the system sends a single job with all the copies; then, the printer proceeds to print all the pages and staple all them as a single document -and that, of course, is not what we desired-. To properly print and staple each of the copy the following workaround can be followed:

  • Print / export the document you want to print as a PDF file. For example, /tmp/myfile.pdf
  • Download and edit this script and change the PRINTER= line adding your printer name (it should not contain any spaces; i.e. "HPLaserJetM604")
  • Make it executable: chmod +x print_copies_and_staple.sh
  • Print the document. For example, to print /tmp/myfile.pdf 100 times, we would use:
# ./print_copies_and_staple.sh 100 /tmp/myfile.pdf

It's not a perfect workaround, but it can save us some time. It probably works with other printers other than the Hewlett Packard M604, but the HPStaplerOptions=1StapleLeftAngled will probably have to be changed to the appropiate option name and value. You can get a list of options for your specific printer using the command lpotions:


# lpoptions -l
PageSize/Media Size: Letter Legal Executive Statement FanFoldGermanLegal 3x5 4x6 5x7 5x8 *A4 A5 A6 FanFoldGerman B5 B6 Env4x6 Oficio 195x270mm 184x260mm 7.75x10.75 Postcard DoublePostcardRotated Env9 Env10 EnvMonarch EnvISOB5 EnvC5 EnvC6 EnvDL Custom.WIDTHxHEIGHT
Collate/Collate: True *False
Duplex/Two-Sided: *None DuplexNoTumble DuplexTumble
InputSlot/Paper Feed: *Auto Tray1 Tray2 Tray3 Tray4 Tray5 Tray6 ManualFeed EnvelopeFeeder
HPOption_Duplexer/Duplex Unit: *True False
HPOption_EnvFeeder/Envelope Feeder: True *False
HPCustomMediaCassetteTray2/Tray 2 with Custom Media Cassette: True *False
HPOption_Tray3/Tray 3: *None HP500SheetInputTray HP1500SheetInputTray
HPOption_Tray4/Tray 4: *None HP500SheetInputTray HP1500SheetInputTray
HPOption_Tray5/Tray 5: *None HP500SheetInputTray HP1500SheetInputTray
HPOption_Tray6/Tray 6: *None HP500SheetInputTray HP1500SheetInputTray
HPOption_MBM_Mixed/HP LaserJet 500-sheet 5-bin Mailbox: *None MailboxMode StackerMode LargeCapacityMode
HPOption_500SheetStaplerStacker/HP 500-Sheet Stapler/Stacker: False *True
HPOption_500SheetStacker/HP 500-Sheet Stacker: *False True
HPPrintQuality/Print Quality: *ImageRet3600 1200x1200dpi
HPEconoMode/EconoMode: True *False
OutputBin/Output Bin: *None StandardTopBin StraightPaperPath StackerBin OutputBins1_5 OutputBin1 OutputBin2 OutputBin3 OutputBin4 OutputBin5
HPStaplerOptions/Staple: *None 1StapleRightAngled 1StapleLeftAngled
HPPinPrnt/Secure Printing: True *False
HPFIDigit/First Digit: *0 1 2 3 4 5 6 7 8 9
HPSEDigit/Second Digit: *0 1 2 3 4 5 6 7 8 9
HPTHDigit/Third Digit: *0 1 2 3 4 5 6 7 8 9
HPFTDigit/Fourth Digit: *0 1 2 3 4 5 6 7 8 9


If you are lazy about finding that option, just set that option as default for printing and remove the "-o HPStaplerOptions=1StapleLeftAngled" part of the script.

Good luck! Any comments and improvements are very welcome.




If you found anything useful enough and you want to thank us for that, please consider donating to people who need it, like the NGO OXFAM. Thank you !


Comments

Comments are manually approved. Just be a bit patient :-)

There are currently no comments

New Comment

required

required (not published)

optional

Recent Tweets