Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Samba HowTo Guide
Prev Home Next

Examples for Filtering Chains

Here are a few examples of commonly occurring filtering chains to illustrate the workings of CUPS.

Assume you want to print a PDF file to an HP JetDirect-connected PostScript printer, but you want to print pages 3-5, 7, and 11-13 only, and you want to print them “two-up” and “duplex”:

  • Your print options (page selection as required, two-up, duplex) are passed to CUPS on the command line.

  • The (complete) PDF file is sent to CUPS and autotyped as application/pdf .

  • The file therefore must first pass the pdftops prefilter, which produces PostScript MIME type application/postscript (a preview here would still show all pages of the original PDF).

  • The file then passes the pstops filter that applies the command-line options: it selects pages 2-5, 7, and 11-13, creates the imposed layout “two pages on one sheet”, and inserts the correct “duplex” command (as defined in the printer's PPD) into the new PostScript file; the file is now of PostScript MIME type application/vnd.cups-postscript .

  • The file goes to the socket backend, which transfers the job to the printers.

The resulting filter chain, therefore, is as shown in the PDF to socket chain illustration.

Figure21.11.PDF to Socket Chain.

PDF to Socket Chain.

Assume you want to print the same filter to an USB-connected Epson Stylus Photo Printer installed with the CUPS stphoto2.ppd. The first few filtering stages are nearly the same:

  • Your print options (page selection as required, two-up, duplex) are passed to CUPS on the command line.

  • The (complete) PDF file is sent to CUPS and autotyped as application/pdf .

  • The file must first pass the pdftops prefilter, which produces PostScript MIME type application/postscript (a preview here would still show all pages of the original PDF).

  • The file then passes the “pstops” filter that applies the command-line options: it selects the pages 2-5, 7, and 11-13, creates the imposed layout “two pages on one sheet,” and inserts the correct “duplex” command (oops this printer and PPD do not support duplex printing at all, so this option will be ignored) into the new PostScript file; the file is now of PostScript MIME type application/vnd.cups-postscript .

  • The file then passes the pstoraster stage and becomes MIME type application/cups-raster .

  • Finally, the rastertoepson filter does its work (as indicated in the printer's PPD), creating the printer-specific raster data and embedding any user-selected print options into the print data stream.

  • The file goes to the usb backend, which transfers the job to the printers.

The resulting filter chain therefore is as shown in the PDF to USB Chain illustration.

Figure21.12.PDF to USB Chain.

PDF to USB Chain.
Samba HowTo Guide
Prev Home Next

 
 
  Published under the terms fo the GNU General Public License Design by Interspire