Common UNIX Printing System (CUPS)‏ Ron Bandes Cloud Nine Networks, LLC
Spoolers <ul><li>CUPS </li></ul><ul><li>LPRng </li></ul><ul><li>LPD </li></ul><ul><li>GNUlpr </li></ul><ul><li>Solaris LP ...
CUPS Overview Application Queue Filters Backend Printer
User Commands
lp & lpr <ul><li>lp  = print  (SysV & CUPS)‏ </li></ul><ul><ul><li>New file </li></ul></ul><ul><ul><ul><li>-d  = destinati...
lpoptions <ul><li>display/set printer options & defaults  (CUPS)‏ </li></ul><ul><ul><li>-d   dest [/ instance ] -o  option...
Common -o options <ul><li>media= letter | legal | a4... </li></ul><ul><li>landscape </li></ul><ul><li>orientation-requeste...
More -o options <ul><li>page-set={odd | even} </li></ul><ul><li>output-order={normal | reverse} </li></ul><ul><li>number-u...
Image -o options <ul><li>position= {center,top,left,right,bottom,top-left...} </li></ul><ul><li>scaling= percent  </li></ul>
lpstat & lpq <ul><li>lpstat – show status (SysV & CUPS)‏ </li></ul><ul><ul><li>-a =  state of ptr queue </li></ul></ul><ul...
cancel & lprm <ul><li>cancel </li></ul><ul><ul><li>-a  = all jobs in dest </li></ul></ul><ul><li>lprm  (Berkeley/CUPS)‏ </...
lppasswd <ul><li>add/change/delete digest passwords </li></ul><ul><ul><li>-a  to  add  new digest  (sysadmin)‏ </li></ul><...
User Defaults <ul><li>lpoptions saves settings in ~/.options </li></ul><ul><ul><li>default  printername   </li></ul></ul><...
System Administration Commands
Application Queue Printer reject enable disable accept queuing/ spooling printing alias lpenable /usr/bin/enable   to avoi...
lpinfo <ul><li>Show available (supported) devices or drivers/PPDs  (CUPS)‏ </li></ul><ul><ul><li>-m  = drivers </li></ul><...
lpadmin <ul><li>Configure printer & class queues  (SysV & CUPS)‏ </li></ul><ul><ul><li>-d  = set default printer/class </l...
lpadmin -o options <ul><li>name </li></ul><ul><li>job-k-limit </li></ul><ul><li>job-page-limit </li></ul><ul><li>job-quota...
lpmove <ul><li>move job or destination to new dest. </li></ul>
Printer Connections
Remote Printer Connections <ul><li>AppSocket (Direct, Socket, JetDirect)‏ </li></ul><ul><ul><li>socket:// address : port ?...
Remote Printer Connections <ul><li>HP JetDirect with IPP </li></ul><ul><ul><li>ipp:// address /ipp [ /port{1 | 2 | 3} ] </...
Option/Value Pairs <ul><li>encryption=always | ifrequested | never | required </li></ul><ul><li>compression=gzip </li></ul...
Glossary & Programs
Glossary <ul><li>job -  set of files that is submitted for printing </li></ul><ul><li>printer class -  Jobs sent to a clas...
Glossary <ul><li>backends -  send the filtered print data to the printer, and determine the available devices. E.g., lpd, ...
Glossary <ul><li>PPD file -  describes the capabilities of each printer . </li></ul><ul><li>client -  machine that sends p...
CUPS Programs <ul><li>foomatic </li></ul><ul><ul><li>configurable printing filter </li></ul></ul><ul><ul><li>transforms PS...
Drivers <ul><li>pxlmono, pxlcolor  – HP LaserJet </li></ul><ul><li>ljet4 </li></ul><ul><li>hpijs  – PCL InkJet </li></ul><...
The End
CUPS Components <ul><li>Queue </li></ul><ul><li>Filter </li></ul><ul><li>Printer driver </li></ul><ul><li>Port monitor </l...
CUPS Components <ul><li>Class </li></ul><ul><li>Page </li></ul><ul><li>Destination </li></ul><ul><ul><li>Printer Q, Class ...
CUPS Components <ul><li>Binary Communications Program – port monitor.  e.g., bcp, tbcp </li></ul>
Ghostscript <ul><li>GNU vs. Easy Software Products (ESP)‏ </li></ul><ul><li>supports printing PostScript files within CUPS...
More Remote Connections <ul><li>Xerox 4512 NIC </li></ul><ul><ul><li>lpd:// address /PORT1 </li></ul></ul><ul><li>XNIC </l...
Upcoming SlideShare
Loading in …5
×

CUPS: Common UNIX Printing System

2,496 views
2,308 views

Published on

Common UNIX Printing System

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,496
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CUPS: Common UNIX Printing System

  1. 1. Common UNIX Printing System (CUPS)‏ Ron Bandes Cloud Nine Networks, LLC
  2. 2. Spoolers <ul><li>CUPS </li></ul><ul><li>LPRng </li></ul><ul><li>LPD </li></ul><ul><li>GNUlpr </li></ul><ul><li>Solaris LP </li></ul><ul><li>PPR – Page Printer Spooler </li></ul><ul><li>PDQ – Print Don't Queue </li></ul><ul><li>CPS </li></ul><ul><li>direct printing (no spooler)‏ </li></ul>
  3. 3. CUPS Overview Application Queue Filters Backend Printer
  4. 4. User Commands
  5. 5. lp & lpr <ul><li>lp = print (SysV & CUPS)‏ </li></ul><ul><ul><li>New file </li></ul></ul><ul><ul><ul><li>-d = destination </li></ul></ul></ul><ul><ul><ul><li>-m = send email when job is completed </li></ul></ul></ul><ul><ul><ul><li>-s = silent (don't report job id)‏ </li></ul></ul></ul><ul><ul><li>Existing file </li></ul></ul><ul><ul><ul><li>-i = job id </li></ul></ul></ul><ul><li>lpr (Berkeley & CUPS)‏ </li></ul><ul><ul><li>-r = delete file after printing </li></ul></ul><ul><ul><li>-P = destination </li></ul></ul>
  6. 6. lpoptions <ul><li>display/set printer options & defaults (CUPS)‏ </li></ul><ul><ul><li>-d dest [/ instance ] -o option = value </li></ul></ul><ul><ul><ul><li>Sets default printer; overrides system default for user </li></ul></ul></ul><ul><ul><li>-l [-p dest ] = lists supported printer-specific options </li></ul></ul><ul><ul><li>-r option [-p dest [/ instance ]] = remove option </li></ul></ul><ul><ul><li>-x dest [/ instance ] = removes options </li></ul></ul><ul><ul><li>When run as root, sets default options and instances for all users in /etc/cups/lpoptions </li></ul></ul>
  7. 7. Common -o options <ul><li>media= letter | legal | a4... </li></ul><ul><li>landscape </li></ul><ul><li>orientation-requested= </li></ul><ul><li>sides= one-sided | two-sided-{long | short}-edge </li></ul><ul><li>fitplot </li></ul><ul><li>scaling= % </li></ul><ul><li>cpi= 10 </li></ul><ul><li>lpi= 6 </li></ul><ul><li>page-{bottom | left | right | top}= points </li></ul><ul><li>Collate=True </li></ul><ul><li>page-ranges= </li></ul>
  8. 8. More -o options <ul><li>page-set={odd | even} </li></ul><ul><li>output-order={normal | reverse} </li></ul><ul><li>number-up={1 | 2 | 4 | 6 | 9 | 16} </li></ul><ul><li>page-border={single | double}[-thick] </li></ul><ul><li>columns= </li></ul><ul><li>prettyprint (header, keyword highlighting)‏ </li></ul><ul><li>raw </li></ul><ul><li>job-sheets= </li></ul>
  9. 9. Image -o options <ul><li>position= {center,top,left,right,bottom,top-left...} </li></ul><ul><li>scaling= percent </li></ul>
  10. 10. lpstat & lpq <ul><li>lpstat – show status (SysV & CUPS)‏ </li></ul><ul><ul><li>-a = state of ptr queue </li></ul></ul><ul><ul><li>-c = classes & member ptrs </li></ul></ul><ul><ul><li>-d = default dest </li></ul></ul><ul><ul><li>-l = long </li></ul></ul><ul><ul><li>-o = jobs queue </li></ul></ul><ul><ul><li>-p = printer's enable-status </li></ul></ul><ul><ul><li>-r = CUPS svr status </li></ul></ul><ul><ul><li>-s = summary (-dcv) ‏ </li></ul></ul><ul><ul><li>-t = total info (-rdcvapo) ‏ </li></ul></ul><ul><ul><li>-v = printer w/device </li></ul></ul><ul><li>lpq (Berkeley)‏ </li></ul><ul><ul><li>+ interval </li></ul></ul>
  11. 11. cancel & lprm <ul><li>cancel </li></ul><ul><ul><li>-a = all jobs in dest </li></ul></ul><ul><li>lprm (Berkeley/CUPS)‏ </li></ul>
  12. 12. lppasswd <ul><li>add/change/delete digest passwords </li></ul><ul><ul><li>-a to add new digest (sysadmin)‏ </li></ul></ul><ul><ul><li>-x to delete digest (sysadmin)‏ </li></ul></ul><ul><ul><li>Neither -a nor -x to change digest (user)‏ </li></ul></ul><ul><ul><li>Digest usernames don't have to match UNIX usernames. </li></ul></ul><ul><ul><li>Digests stored in /etc/cups/passwd.md5 </li></ul></ul>
  13. 13. User Defaults <ul><li>lpoptions saves settings in ~/.options </li></ul><ul><ul><li>default printername </li></ul></ul><ul><li>export Bash variable from ~/.bash_profile </li></ul><ul><ul><li>PRINTER= </li></ul></ul><ul><ul><li>LPDEST= </li></ul></ul>
  14. 14. System Administration Commands
  15. 15. Application Queue Printer reject enable disable accept queuing/ spooling printing alias lpenable /usr/bin/enable to avoid enable builtin
  16. 16. lpinfo <ul><li>Show available (supported) devices or drivers/PPDs (CUPS)‏ </li></ul><ul><ul><li>-m = drivers </li></ul></ul><ul><ul><li>-v = devices </li></ul></ul><ul><ul><ul><li>-l = long </li></ul></ul></ul><ul><li>device URIs </li></ul><ul><ul><li>file:/directory/filename </li></ul></ul><ul><ul><li>method://server </li></ul></ul><ul><ul><li>method://server/path </li></ul></ul>
  17. 17. lpadmin <ul><li>Configure printer & class queues (SysV & CUPS)‏ </li></ul><ul><ul><li>-d = set default printer/class </li></ul></ul><ul><ul><li>-p configures printer with options </li></ul></ul><ul><ul><ul><li>-c Add printer to class </li></ul></ul></ul><ul><ul><ul><li>-u User-level access </li></ul></ul></ul><ul><ul><ul><li>-v URI </li></ul></ul></ul><ul><ul><ul><li>-P PPD </li></ul></ul></ul><ul><ul><ul><li>-o option = value </li></ul></ul></ul><ul><ul><li>-x = deletes printer/class </li></ul></ul>
  18. 18. lpadmin -o options <ul><li>name </li></ul><ul><li>job-k-limit </li></ul><ul><li>job-page-limit </li></ul><ul><li>job-quota-period </li></ul><ul><li>job-sheets-default </li></ul><ul><li>port-monitor </li></ul><ul><li>printer-error-policy= {abort-job, retry-job, stop-printer } </li></ul><ul><li>printer-is-shared= { true ,false} </li></ul><ul><li>printer-op-policy </li></ul>
  19. 19. lpmove <ul><li>move job or destination to new dest. </li></ul>
  20. 20. Printer Connections
  21. 21. Remote Printer Connections <ul><li>AppSocket (Direct, Socket, JetDirect)‏ </li></ul><ul><ul><li>socket:// address : port ?waiteof=false </li></ul></ul><ul><ul><li>Simplest, fastest, most reliable </li></ul></ul><ul><li>Internet Printing Protocol (IPP)‏ </li></ul><ul><ul><li>http:// address : port / resource ? option = value & option = value </li></ul></ul><ul><ul><li>http:// address :631/printers/ queue </li></ul></ul><ul><ul><li>Preferred </li></ul></ul>
  22. 22. Remote Printer Connections <ul><li>HP JetDirect with IPP </li></ul><ul><ul><li>ipp:// address /ipp [ /port{1 | 2 | 3} ] </li></ul></ul><ul><li>Line Printer Daemon (lpd)‏ </li></ul><ul><ul><li>lpd:// address / queue ? option = value & option = value </li></ul></ul><ul><ul><ul><li>Not recommended </li></ul></ul></ul><ul><li>Server Message Block (Microsoft Ntwkg) Common Internet File System (CIFS)‏ </li></ul><ul><ul><li>smb://[ user [: pass ]@][ workgroup /] server / sharename </li></ul></ul>
  23. 23. Option/Value Pairs <ul><li>encryption=always | ifrequested | never | required </li></ul><ul><li>compression=gzip </li></ul><ul><li>version=1.0 (default 1.1) ‏ </li></ul><ul><li>waitjob=false </li></ul><ul><li>waitprinter=false </li></ul>
  24. 24. Glossary & Programs
  25. 25. Glossary <ul><li>job - set of files that is submitted for printing </li></ul><ul><li>printer class - Jobs sent to a class are forwarded to the first available printer in the class. Classes can be members of other classes. </li></ul><ul><li>filters - Some filters convert job files to different formats that the printer can understand. Others perform page selection and ordering tasks. E.g., commandtocanon, commandtoepson, cupsomatic (foomatic-rip), gziptoany, hpgltops, imagetops, imagetoraster, pdftops, pstops, pstopxl, pstoraster, rastertolabel, rastertoepson, rastertogutenprint, rastertohp, rastertolabel, texttops . </li></ul>
  26. 26. Glossary <ul><li>backends - send the filtered print data to the printer, and determine the available devices. E.g., lpd, parallel, serial, usb, bluetooth, hp, http, ipp, smb, socket, beh ( Backend Error Handler) . </li></ul><ul><li>printer drivers - filters specific to a printer. </li></ul><ul><li>implicit classes - collections of printers and/or classes with the same name. </li></ul><ul><li>printer instances - define different sets of options for each printer. </li></ul>
  27. 27. Glossary <ul><li>PPD file - describes the capabilities of each printer . </li></ul><ul><li>client - machine that sends print jobs to another machine, or self, for final printing. </li></ul>
  28. 28. CUPS Programs <ul><li>foomatic </li></ul><ul><ul><li>configurable printing filter </li></ul></ul><ul><ul><li>transforms PS to raster or printer language </li></ul></ul><ul><ul><li>uses PPD files and Ghostscript </li></ul></ul><ul><li>cupsomatic </li></ul><ul><ul><li>foomatic CUPS printer filter </li></ul></ul><ul><ul><li>executes Ghostscript instead of CUPS-native pstoraster </li></ul></ul><ul><li>Ghostscript </li></ul><ul><ul><li>interpreter for PostScript and PDF </li></ul></ul><ul><ul><li>Raster Image Processor (RIP)‏ </li></ul></ul><ul><li>gutenprint (formerly gimp-print)‏ </li></ul><ul><ul><li>collection of free software printer drivers </li></ul></ul>
  29. 29. Drivers <ul><li>pxlmono, pxlcolor – HP LaserJet </li></ul><ul><li>ljet4 </li></ul><ul><li>hpijs – PCL InkJet </li></ul><ul><li>splix – Samsung Printer Language </li></ul><ul><li>gdi – Samsung SmartGDI </li></ul>
  30. 30. The End
  31. 31. CUPS Components <ul><li>Queue </li></ul><ul><li>Filter </li></ul><ul><li>Printer driver </li></ul><ul><li>Port monitor </li></ul><ul><li>Backend </li></ul><ul><li>Job </li></ul><ul><li>Operation policies </li></ul><ul><li>Operation </li></ul><ul><li>Printer </li></ul><ul><li>Scheduler (cupsd) ‏ </li></ul><ul><li>O.P. Access ctrl rules </li></ul><ul><ul><li>For printers / tasks / svcs </li></ul></ul><ul><ul><li>cupsd.conf policy sects & limit subsects </li></ul></ul><ul><li>Location-based access ctrl rules </li></ul><ul><ul><li>Server-wide </li></ul></ul><ul><li>Location </li></ul>
  32. 32. CUPS Components <ul><li>Class </li></ul><ul><li>Page </li></ul><ul><li>Destination </li></ul><ul><ul><li>Printer Q, Class Q </li></ul></ul><ul><li>Instance [of destination] </li></ul><ul><li>Device </li></ul><ul><li>CGI programs: admin,classes,help,jobs,printers </li></ul><ul><li>RIP – Raster Image Processor filter, e.g., imagetoraster, pstoraster)‏ </li></ul>
  33. 33. CUPS Components <ul><li>Binary Communications Program – port monitor. e.g., bcp, tbcp </li></ul>
  34. 34. Ghostscript <ul><li>GNU vs. Easy Software Products (ESP)‏ </li></ul><ul><li>supports printing PostScript files within CUPS driver framework </li></ul>
  35. 35. More Remote Connections <ul><li>Xerox 4512 NIC </li></ul><ul><ul><li>lpd:// address /PORT1 </li></ul></ul><ul><li>XNIC </li></ul><ul><ul><li>lpd:// address /PASSTHRU </li></ul></ul><ul><li>others </li></ul><ul><ul><li>socket:// address :5503 </li></ul></ul>

×