Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Apress - Books for Professionals by Professionals

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 86 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

HOWTO Home

Current HOWTO: Printing-HOWTO


How it all works

7. How it all works

In order to get printing working well, you need to understand how your spooling software works. All systems work in essentially the same way, although the exact order might vary a bit, and some systems skip a step or two:

Figure 10. Spooling Illustration

  1. The user submits a job along with his selection of options. The job data is usually, but not always, Postscript.

  2. The spooling system copies the job and the options over the network in the general direction of the printer.

  3. The spooling system waits for the printer to be available.

  4. The spooling system applies the user's selected options to the job, and translates the job data into the printer's native language, which is usually not Postscript. This step is called filtering; most of the work in setting things up lies in getting the proper filtering to happen.

  5. The job is done. The spooling system will usually do assorted cleanup things at this point. If there was an error along the way, the spooler will usually notify the user somehow (for example, by email).

7.1. CUPS

To print a job with CUPS, you can use both the BSD (see Section 5.3.1) and System V commands making it really easy for people with prior experience with either system.

Figure 11. Simplified CUPS illustration

Initially CUPS lacked an LPD backend. This was of course quickly added. Currently there are backends available for at least IPP, LPD, SMB, JetDirect, USB, Netatalk, parallel and serial printers. You may find others on the net or write your own.

There are only a handfull of built-in drivers, allowing you to print with most printers but probably not at the maximum resolution. A PPD file for a Postscript driver can be added to CUPS but if you want to print at best quality with your fancy new HP Deskjet you are out of luck. It is here that Foomatic comes to the rescue. You can use Foomatic in combination with CUPS. Foomatic uses a CUPS filter called foomatic-rip to do its magic. foomatic-rip uses PPD files to describe printer capabilities, even for non-Postscript printers. CUPS + Foomatic is currently the recommended printing system. Some Linux distributions already use it and the number that do will only grow.

The CUPS scheduler does not only accept jobs, it is also a administrative webinterface. Currently you can add/delete printers, cancel jobs, start/stop printers. Moving jobs will be available in a later release.

7.2. LPD

Lpd stands for Line Printer Daemon, and refers in different contexts to both the daemon and the whole collection of programs which run print spooling. These are:

lpd

The spooling daemon. One of these runs to control everything on a machine, AND one is run per printer while the printer is printing.

lpr

The user spooling command. Lpr contacts lpd and injects a new print job into the spool.

lpq

Lists the jobs in a print queue.

lpc

The Lpd system control command. With lpc you can stop, start, reorder, etc, the print queues.

lprm

lprm removes a job from the print spool.

So how does it fit together? The following things happen:

  1. At boot time, lpd is run. It waits for connections and manages printer queues.

  2. A user submits a job with the lpr command or, alternatively, with an lpr front-end like GPR, PDQ, etc.Lpr contacts lpd over the network and submits both the user's data file (containing the print data) and a control file (containing user options).

  3. When the printer becomes available, the main lpd spawns a child lpd to handle the print job.

  4. The child lpd executes the appropriate filter(s) (as specified in the if attribute in/etc/printcap) for this job and sends the resulting data on to the printer.

The lp system was originally designed when most printers were line printers - that is, people mostly printed plain ASCII. By placing all sorts of magic in the if filter, modern printing needs can be met with lpd (well, more or less; many other systems do a better job).

There are many programs useful for writing LPD filters. Among them are:

gs

Ghostscript is a host-based Postscript interpreter (aka a Raster Image Processor or RIP). It accepts Postscript and produces output in various printer languages or a number of graphics formats. Ghostscript is covered in Section 10.

ppdfilt

ppdfilt is a standalone version of a CUPS component. It filters Postscript, executing a few basic transformations on it (n-up printing, multiple copies, etc) and adding in user option statements according to a Postscript Printer Definition (PPD) file usually included with Postscript printers.

ppdfilt is best used together with an option-accepting LPD system (like the GNUlpr, or LPRng) and a filter script which parses user-provided options into the equivalent ppdfilt command. VA Linux and HP provide a modified rhs-printfilters package which does exactly this; it produces nice results if you have a Postscript printer. See Section 8.2.2 for information on this system.

ps2ps

ps2ps is a utility script included with Ghostscript. It filters Postscript into more streamlined Postscript, possibly at a lower Language Level. This is useful if you have an older Postscript printer; most modern software produces modern Postscript.

mpage

mpage is a utility which accepts text or Postscript, and generates n-up output—that is, output with several page images on each piece of paper. There are actually several programs which do this, includingenscript, nenscript, anda2ps.

a2ps

a2ps, aka any-to-ps, is a program which accepts a variety of file types and converts them to Postscript for printing.


The Linux Tutorial completely respects the rights of authors and artists to decide for themselves if and how their works can be used, independent of any existing licenses. This means if you are the author of any document presented on this site and do no wish it to be displayed as it is on this site or do not wish it to be displayed at all, please contact us and we will do our very best to accommodate you. If we are unable to accommodate you, we will, at your request, remove your document as quickly as possible.

If you are the author of any document presented on this site and would like a share of the advertising revenue, please contact us using the standard Feedback Form.


  




Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
You can choose larger fonts by selecting a different themes.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.15 Seconds