Skip to content

Instantly share code, notes, and snippets.

@leingang
Last active September 16, 2024 21:10
Show Gist options
  • Save leingang/b782762d50e362baf2c8902e1692112f to your computer and use it in GitHub Desktop.
Save leingang/b782762d50e362baf2c8902e1692112f to your computer and use it in GitHub Desktop.
Print to CIMS printers with stapling (bypassing Pharos)
alias sshlpr='ssh [email protected] lpr -P mf-07 -o sides=two-sided-long-edge -o StapleLocation=UpperLeft'
ssh [email protected] lpr -P mf-07 -\\# 25 -o sides=two-sided-long-edge -o ColorMode=Gray -o StapleLocation=UpperLeft < file.pdf
@leingang
Copy link
Author

leingang commented Aug 16, 2023

To use this shell one-liner:

  • replace leingang with your own CIMS username
  • replace mf-07 with the printer you are printing to
  • replace 25 with the number of copies you want
  • replace file.pdf with the file name you are printing
  • leave out -o ColorMode=Gray if you want color printouts
  • leave out -o StapleLocation=UpperLeft if you have only a single sheet, or you don't want them stapled.
  • leave out -o sides=two-sided-long-edge to only get single-sided pages
  • add -o page-ranges=m-n to print only the pages in the range m to n

Notes:

  1. The double backslash escapes the pound sign twice
  2. You will still need to authenticate on the CIMS systems with password and MFA

See also How to Use SSH Pipes on Linux

@leingang
Copy link
Author

I wanted to find an lpr option to print (labels) using the manual feed on bwpr23, but it doesn't seem to have such an option.

@leingang
Copy link
Author

leingang commented Sep 3, 2024

Options have changed a bit since I last used this. Double check stapling and color next time you get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment