1. Trang chủ
  2. » Công Nghệ Thông Tin

Common UNIX Printing System Sweet phần 1 pot

64 229 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 64
Dung lượng 5,32 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

< previous page page_ii next page >Page ii Common UNIX Printing System Copyright © 2002 by Sams Publishing All rights reserved.. < previous page page_vi next page >Page vi Installing or

Trang 1

cover next page >

Cover

title : Common UNIX Printing System

author : Sweet, Michael

publisher : Pearson Education, Inc

subject : UNIX (Computer file) , Client/server computing, Printing

Trang 2

< previous page page_i next page >

Trang 3

< previous page page_ii next page >

Page ii

Common UNIX Printing System

Copyright © 2002 by Sams Publishing

All rights reserved No part of this book shall be reproduced, stored in a retrieval system, or transmitted

by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher No patent liability is assumed with respect to the use of the information contained herein Although every precaution has been taken in the preparation of this book, the publisher and

author assume no responsibility for errors or omissions Nor is any liability assumed for damages resulting from the use of the information contained herein

International Standard Book Number: 0-672-32196-3

Library of Congress Catalog Card Number: 2001089505

Printed in the United States of America

First Printing: August 2001

04 03 02 01 4 3 2 1

Trademarks

The UNIX trademark is also shown as Unix; both are registered trademarks of the X Open Group, Inc All other terms mentioned in this book that are known to be trademarks or service marks have been

appropriately capitalized Sams Publishing cannot attest to the accuracy of this information Use of a term

in this book should not be regarded as affecting the validity of any trademark or service mark

Warning and Disclaimer

Every effort has been made to make this book as complete and as accurate as possible, but no warranty

or fitness is implied The information provided is on an ''as is" basis

Trang 4

< previous page page_iii next page >

Part III Programming with CUPS

Trang 5

< previous page page_iv next page >

Trang 6

< previous page page_v next page >

Page v

Contents

Part 1 Using CUPS

Trang 7

< previous page page_vi next page >

Page vi

Installing or Upgrading a Portable Distribution 32

Adding Your First Printer from the Command-Line 47

Configuring Your Printer from the Command-Line 48

Configuring Your Printer from the Web Interface 51

Managing Printer Classes from the Command-Line 63

Trang 8

< previous page page_vii next page >

Page vii

Checking the Printer Status from the Command Line 83

Canceling a Print Job from the Web Interface 84

Trang 9

< previous page page_viii next page >

Trang 10

< previous page page_ix next page >

Page ix

Part II The Internet Printing Protocol

The multiple-document-jobs-supported Attribute 157

Trang 11

< previous page page_x next page >

Page x

The printer-message-from-operator Attribute 158

The printer-more-info-manufacturer Attribute 158

The reference-uri-schemes-supported Attribute 159

Trang 12

< previous page page_xi next page >

Page xi

Trang 13

< previous page page_xii next page >

Page xii

Trang 14

< previous page page_xiii next page >

Trang 15

< previous page page_xiv next page >

Part III Programming With CUPS

Detecting the CUPS API Library with GNU Autoconf 224

Trang 16

< previous page page_xv next page >

Trang 17

< previous page page_xvi next page >

Page xvi

Trang 18

< previous page page_xvii next page >

Page xvii

Understanding PostScript Printer Description (PPD) Files 334

Basics of Error-Diffusion Dithering Algorithms 357

Implementing the Floyds-Steinberg Algorithm 358

Trang 19

< previous page page_xviii next page >

Page xviii

Trang 20

< previous page page_xix next page >

Trang 21

< previous page page_xx next page >

Trang 22

< previous page page_xxi next page >

Trang 23

< previous page page_xxii next page >

Trang 24

< previous page page_xxiii next page >

GNU GENERAL PUBLIC LICENSE—TERMS AND CONDITIONS FOR COPYING,

Trang 25

< previous page page_xxiv next page >

Page xxiv

About the Author

Michael Sweet is co-owner of Easy Software Products, a small software firm specializing in Internet and

printing technologies He first started using a computer terminal at the age of 6 and sold his first program

at age 12 Michael's obsession with printing and graphics led him to develop image-printing software for dot-matrix and later inkjet printers After graduating with a bachelor's degree in computer science from the SUNY Institute of Technology in Utica/Rome, he moved to Maryland to pursue a career in real-time computer graphics for the Navy

The draw of printing was too much After a few years working for the Navy, Michael again began writing printer drivers After releasing a freeware program called ''topcl," he went on to found Easy Software Products and develop the highly successful ESP Print software In 1997, Michael began work on the

Common UNIX Printing System, and in 1999, his company released CUPS under the GNU GPL license and ESP Print Pro as a commercial product

Aside from writing printer drivers, Michael is also author or co-author of several books, including the Serial Programming Guide for POSIX Operating Systems and the OpenGL Superbible When he has free time, he enjoys cycling, photography, playing the trumpet, and travelling with his wife, Sandra

About the Technical Editor

Tim Hicks is a Senior Unix Engineer for HomeSide Lending, Inc He is an HP Certified IT Professional in

HP-UX Systems Administration and has been working extensively with HP-UX 10.10-11.00 as well as some work with Solaris 8, AIX 4.1, FreeBSD, and RedHat 6.2 He has an in-depth knowledge and experience with Highly Available Clusters using HP' MC/ServiceGuard, HP-UX 11.00, and Oracle 8.05, as well as

Sybase 11 He is currently implementing Storage Area Networks with EMC Fabric Directors and Switches Tim graduated from Florida State University with a B.S in both Management Information Systems and Finance

Trang 26

< previous page page_xxv next page >

My life as a computer scientist started with my parents Thanks, Dad, for bringing that first terminal home when I was 6, and Mom, for putting up with the computer books at the dinner table You always gave me what I needed, whether it was Legos, books, or computers I feel so very fortunate to have such loving parents

My friends Andy and Tammy have walked the tricky path of running a computer software company with me; thanks for being a second family I don't think we'd be as successful as we are without our friendship.Jim is the person that pointed out that our little printer driver utility was more important than another 3D modeler Thanks, Jim, for helping us see the forest for the trees

I'd like to thank Carl Uno Manros, chairperson of the Internet Printing Protocol working group and the man who put the bug in my ear to write a printing book for IPP His steady hand, even during sometimes heated debate among the IPP working group participants, has helped create a network printing protocol that everyone can be proud of and use

I'd also like to thank the folks at Sams Publishing for seeing the potential of this book Katie Purdum has worked with me almost from the beginning, and her support and enthusiasm made writing the book a joy

My project editor George Nedeff as well as editors Margo Catts, Cynthia Fields, Tim Hicks, and Mark

Renfrow all contributed greatly to the consistency, accuracy, and readability of the book Finally, enough can't be said for the production staff who take the final text, images, and figures and turn them into an actual book The amount of work that is put into each and every book boggles my mind

CUPS wouldn't be possible without the many contributions from the open source community L.Peter Deutsch developed the Ghostscript software that CUPS uses to support non-PostScript printers, and Derek Noonburg developed the Xpdf software that is used to print PDF files Crutcher Dunnavant, Han Holl, Till Kamppeter, Sebastian Krahmer, Robert Krawitz, Johnny Lam, Jeff Licquia, Kurt Pfeifle, Klaus Singvogel, Grant Taylor, and many others have contributed greatly to the success and stability of the CUPS software

Trang 27

< previous page page_xxvi next page >

Page xxvi

Tell Us What You Think!

As the reader of this book, you are our most important critic and commentator We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us

publish in, and any other words of wisdom you're willing to pass our way

As an Associate Publisher for Sams Publishing, I welcome your comments You can fax, e-mail, or write

me directly to let me know what you did or didn't like about this book—as well as what we can do to make our books stronger

Please note that I cannot help you with technical problems related to the topic of this book, and that due

to the high volume of mail I receive, I might not be able to reply to every message

When you write, please be sure to include this book's title and author as well as your name and phone or fax number I will carefully review your comments and share them with the author and editors who

worked on the book

Trang 28

< previous page page_1 next page >

Page 1

INTRODUCTION

The History of Printing in Unix

In the beginning of human history, knowledge was passed from person to person and generation to

generation through direct, spoken communication Over the millennia this knowledge transfer has

changed from drawings on walls of caves, stone tablets, scrolls, and finally flat, printed, paper

Improvements in communication have driven technological and social change

Throughout the history of computing, printed communication has played a major role in the development and improvements in computers and peripherals It is not surprising, then, that in the early days of Unix the first killer app was a word processor With word processing, lawyers, academics, journalists, and scientists were able to better communicate The line printer daemon (''LPD") was developed to spool and send the print files to the printer Originally developed for communication with text printers, LPD can send any kind of file to a printer Later incarnations of Unix added a new line printer system ("LP"), which was incompatible with the old LPD but supported options for print jobs and filtering of the job files However, very little has changed for Unix printing over the 30 years since Unix was first created—applications

produce output suitable for the printer, and the spooler sends this file to the printer

Trang 29

< previous page page_2 next page >

Page 2

Printing from Personal Computers

When the IBM Personal Computer appeared in 1981, it duplicated the Unix printing model Applications came with a certain knowledge of the escape codes and capabilities of popular printers, and users could tell those applications which codes to use for their particular printer If you wanted to print files in the background, a ''print" command was available that would spool jobs to a disk and print them while you worked on something else

As printers began to support graphics, applications had to support numerous different command sets and capabilities, as well as mixed text and graphics The complexity of the software used to communicate with printers soon began to rival the applications themselves, and it wasn't long before these "printer drivers" were an industry of their own Unfortunately, a printer driver for one application rarely worked with

another

Apples' release of the MacIntosh computer changed how printing was done on the personal computer Designed from the beginning to be a desktop publishing system, the MacIntosh abstracted the printing interface away from the application Applications only had to tell the printing system where and what to print, and the printing system would translate that request into the desired output on the selected printer Printer drivers were provided with MacOS or with the printer you purchased for your printer The same driver supported all MacOS applications, and for a short time the MacIntosh ruled the desktop publishing market

Microsoft's first Windows operating environment duplicated this paradigm, and to this day printing and displaying information is handled almost identically in Windows and MacOS Applications for these

operating systems and others like NeXT and BeOS are able to produce professional-quality output with a generic printing interface, yet until recently Unix has only had its print file spooling system

The Evolution of CUPS

In 1993 a new company called Easy Software Products was formed As one of its founders, my job was to develop a modeling program to build 3D images of aircraft, tanks, ships, and so forth While developing this program I ran into a problem—how would we support printing of these models?

Applications in Unix almost universally produce Adobe PostScript files for printing PostScript is a computer language that describes pages mathmatically and is the language of choice for most high-end printers and imagesetters PostScript is even used for display and was used by the NeWS window environment under the IRIX, NeXT, and Solaris operating systems

However, PostScript is not generally supported by consumer-level printers and we certainly didn't have a PostScript printer in our office At the time, Ghostscript (a popular free PostScript interpreter) was not an option, so we had to write our own printer drivers just as thousands of other companies have done before us

Trang 30

< previous page page_3 next page >

Page 3

I had written printer drivers before for the Radio Shack Color Computer and later the ill-fated MM/1

computer under the OS-9 operating system, so I took the code from those old programs and created and released to the public a program called topcl Topcl took an RGB image file and converted it to HP Page Control Language (PCL) for a variety of HP and compatible printers This combined with the tops program supplied with the IRIX operating system were enough to provide the printing support needed for our modeler

Then one day a friend of mine visited our one-room office and I showed him our modeling program During my demo he asked why we were trying to sell yet another 3D modeling program for IRIX, and why

we didn't try selling the printer drivers ''After all," he said, "you had to develop drivers, don't you think other people need them, too?"

Not too long after this discussion, Silicon Graphics released a new printing product called Impressario Impressario did many good things It introduced the concept of filtering print files to convert them to a printable format It included a PostScript interpreter to convert PostScript files to a raster format for non-PostScript printers, and it provided a common driver interface that could be used to develop printer

drivers for almost any kind of printer For all these good things, Impressario lacked printer drivers

We released the first version of ESP Print in 1994, and by 1995 we stopped development of our modeling program to work exclusively on ESP Print New releases of ESP Print included a modified version of

Ghostscript that acted as a drop-in replacement for the Impressario PostScript interpreter, and we

continued to add printer drivers as new printers became available ESP Print was eventually ported to Solaris and HP-UX, and each operating system added a new wrinkle to an already complex software

package

In 1997 we started looking at supporting the Digital Unix and Linux operating systems Unfortunately, these operating systems used the original LPD for printing so you couldn't pass options to the printer drivers This alone would cripple any drivers we might develop To make matters more complicated, at least three versions of LPD were in common use, and they were not 100% compatible with each other

We knew then that we had to take the next step and replace both LPD and LP

The original design of the Common UNIX Printing System (CUPS) was based around the LPD network protocol (see Figure IN.1) We added support for options and remote administration, and were just

finishing the design of the new system when the Internet Printing Protocol (IPP) working group was

created The IPP working group originally was just going to update the LPD network protocol, but quickly changed its direction to create a much more functional and extensible protocol that could evolve as

needed to support new technologies

The switch to IPP probably delayed the release of CUPS by about 18 months, but I think everyone is happier for it By supporting IPP, CUPS can accept and send print jobs almost anywhere CUPS also

provides the infrastructure needed to support modern printing and printers, something that printer

manufacturers need to support their printers under Unix

Trang 31

< previous page page_4 next page >

Page 4

Trang 32

FIGURE IN.1

The first design notes for CUPS

Ngày đăng: 08/08/2014, 21:21

TỪ KHÓA LIÊN QUAN