Differences between revisions 48 and 49
Revision 48 as of 2007-04-13 13:29:20
Size: 14624
Comment:
Revision 49 as of 2007-05-21 11:00:28
Size: 14888
Comment:
Deletions are marked like this. Additions are marked like this.
Line 108: Line 108:
|| job-sheets=VALUE || use specified bannerpages || lpr -o job-sheets=none file.ps || possible values: '''none''': no Banner, '''desyTray2''': print bannerpage from Tray 2, '''desyTray5''': print bannerpage from Tray 5, see Cups User Manual for default values ||

TableOfContents

Printing with Cups Server ZNCUPS

at DESY Zeuthen, the current printing system LPRng will be replaced by the Common Unix Printing System ([http://www.cups.org CUPS]). The reasons are

  • CUPS is better integrated in Linux Desktops like KDE and Gnome, as well as into more and more applications, like OpenOffice, Adobe Reader, etc.

  • With CUPS and Samba the Windows users will be able to control (cancel,...) their print jobs.
  • LPRng is no longer being developed, nor supported.
  • printing administration will be much easier.

With this change of the printing system, NEW - shorter - printer names will be introduced. Alias names are not supported in CUPS.

Network Printers

Windows Printing

  • printing works both for domain members and guest hosts
    • click "run" in the Startmenu
    • type "\\zncups" and press Enter. Your PC or notebook will now connect to the print server.
    • choose a printer. double click to add a printer to your host. The printer drivers will be downloaded.
    • go to "Printers and Faxes" in the Startmenu if you want to change the Printers configuration.
    • from now on you can use the chosen printer
  • canceling a print job
    • Click on "Printers and Faxes" in the Start menu
    • Double click on the printer holding the print job
    • Click with the Right Mouse Button on the print job you want delete
    • Click on "Cancel"
    • Click on "Yes"
  • There are special queues for printing on transparencies or A3-paper without changing the printing preferences.

UNIX Printing

  • default printer: set LPDEST to your favorite printer
    • default: znlo1 (location: 2L01)
    • zsh:
      • edit $HOME/.zprofile and add or modify the line

        • export LPDEST=your_printer

      • make a new login or run in every window
        • . .zprofile

      • please check your .zshenv too and remove LPDEST entries

    • tcsh:
      • edit $HOME/.login and add or modify the line

        • setenv LPDEST your_printer

      • make a new login or run in every window
        • source .login

      • please check your .cshrc too and remove LPDEST entries

  • Printing with the CLI (command line interface)
    • using lpr: lpr -Pprinter myfile

    • using lp: lp -dprinter myfile

  • Examining the print queue with the CLI
    • display a specific queue: lpstat -pprinter

    • display all available queues: lpstat -p
    • list all active jobs: lpstat -o
  • Cancelling of print jobs with the CLI
    • The CUPS job on the local system gets a job-id which is not suitable for removing a job on the print server. The job-id on the print server is different, it can be displayed using lpstat. After finding out the job-id on the print server you can remove it. Use cancel and no longer lprm for removing your print jobs. Examples:
    • cancel your last job on printer with: cancel printer

    • cancel specific jobs: first get the job-ids using lpstat, afterwards use cancel:
          [myhost] % lpstat -o
           znrz1-31                ottostr        1688576   Thu Jan  4 12:20:51 2007
           znrz1-32                frida         31596544   Thu Jan  4 12:20:55 2007
           znrz1-33                wwinzig        1654900   Thu Jan  4 12:30:57 2007
           znrzc-34                ottostr       61533324   Thu Jan  4 12:32:13 2007
          [myhost] % cancel znrz1-31 znrzc-34

Overview of Cups Printing Options on UNIX

Printing Options are passed to Cups using the -o Option of lp and lpr:

  • lpr -o option1=value1 -o option2=value2 [...] file

  • lp -o option1=value1 -o option2=value2 [...] file

Option

Meaning

Example

Comment

sides=one-sided

disables duplex printing

lpr -o sides=one-sided testpage.ps

use printer/simplex if supported

sides=two-sided-short-edge

enables duplex printing for landcape pages

lpr -o sides=two-sided-short-edge myfile.gif

sides=two-sided-long-edge

enables duplex printing for portrait pages

lpr -o sides=two-sided-long-edge info.txt

default

page-ranges=RANGE

not the complete document is printed, but only the specified pages

lpr -o page-range=1,3-5,7 docu.ps

number-up=number

places multiple document pages on a single printed page

lpr -o number-up=4 project.pdf

supported are: 1, 2, 4, 6, 9, and 16

Resolution=xxx

changes printers resolution

lpr -o Resolution=600dpi testpage.ps

lpoptions can be used to find out supported Resoltions fo a queue:  lpoptions -p queuename -l |grep Resolution 

media=Transparency

prints on transparent Media

lpr -o media=Transarency talk.ps

use printer/transp if supported

PageSize=A3

prints on DIN A3 paper

lpr -o PageSize=A3 picture.gif

use printer/A3 if supported

scaling=number

The scaling value is a number from 1 to 800 specifying the size in relation to the page (not the image.)

lpr -o scaling=100 pict.gif

can be used for image formats (GIF,JPEG,TIFF,...)

landscape

rotate the page 90 degrees to print in landscape orientation

lpr -o landscape picture.jpg

orientation-requested=N

rotates the page depending on the value of N

lpr -o orientation-requested=4 file.ps

possible values: 3: no rotation, 4: 90 degrees, 5: 270 degrees, 6: 180 degrees

job-sheets=VALUE

use specified bannerpages

lpr -o job-sheets=none file.ps

possible values: none: no Banner, desyTray2: print bannerpage from Tray 2, desyTray5: print bannerpage from Tray 5, see Cups User Manual for default values

For more options and additional information see the [http://zncups.ifh.de:631/sum.html "Cups Software User Manual"]

Frequently Asked Questions

Which file formats can Cups process ?

  • PostScript, PDF, International Text, TIFF, GIF, PNG, JPEG, SUN−Raster and other graphic formats

  • CUPS uses the rules in the configuration file /etc/cups/mime.types to determine the MIME type of files to be printed. From the MIME type CUPS is deriving the printing format.

Which applications do offer a tight cups integration on a UNIX system ?

  • Acrobat Reader
  • OpenOffice

  • Gimp
  • Firefox/Thunderbird
  • ...

How can I select the simplex mode on a duplex printer under UNIX ?

  • use option sides=one-sided

  • using lpr: lpr -Pprinter -o sides=one-sided myfile

  • using lp: lp -d printer -o sides=one-sided myfile

  • if a simplex instance exists: lp -d printer/simplex myfile

Why there are no A3 and transparency queues anymore?

  • With CUPS there is only one queue for a given printer. The filtering of the print job will be done on the local host, no longer on the print server. Instead of selecting features by queue name the user now has to use command line options or the GUI to use specific features.
  • Printer specific options and their current settings can be listed with
    • lpoptions -p printer -l

  • examples for selecting features
    • A3 printing: lp -o pagesize=A3 file.ps
    • printing on transparencies: lpr -o media=Transparency talk.ps

How can I change personal printer specific option settings?

  • Use lpoptions to save personal option settings in ~/.lpoptions. Example: lpoptions -o pagesize=A3 -p znecad

How can I print multiple copies of a document using the CLI?

  • lp -n number-of-copies file

Copies are not collated by default. Use the -o Collate=True option to get collated copies:

  • lp -n number-of-copies -o Collate=True file

How can I change the layout of the output pages when using N-Up printing?

In order to change the borders around each page, use the -o page-border=value option. Supported borders are:

  • none: do not draw a border (default)

  • double: draw two hairline borders around each page

  • double-thick: draw two 1pt borders around each page

  • single: draw one hairline border around each page

  • single-thick: draw one 1pt border around each page

Example: lp -o number-up=4 -o page-border=double myfile

In order to change the arrangement of the pages on each output page, use the -o number-up-layout=value option. Possible values are:

  • lrtb: Left to right, top to bottom (default)

  • lrbt: Left to right, bottom to top

  • rlbt: Right to left, bottom to top

  • rltb: Right to left, top to bottom

  • tblr: Top to bottom, left to right

  • tbrl: Top to bottom, right to left

  • btlr: Bottom to top, left to right

  • btrl: Bottom to top, right to left

Explanation: The default layout is lrtb(Left to right, top to bottom). This means: using a number-up of 4, the first page will be printed on the top-left of the outputpage, the second page will be printed on the top-right, the third page will be printed on the bottem-left and the fourth page on the bottom-right of the outputpage.

Example: lp -o number-up=4 -o number-up-layout=btrl myfile

I'm using psutils (pstops,psnup,psbook). Even though I'm using the option ''sides=two-sided-short-edge'' the output was not arranged in the correct order. What can I do?

  • The psutils suite of programs is not compatible with the CUPS postscript processing (filter). It is unmaintained since a long time, therefore improvement of the situation is unlikely.
  • With the following command you can bypass the postscript filter
    • lp -o document-format=application/bindshort -dprinter myfile

I'm using psutils (pstops,psnup,psbook). On the Xerox Color Printer I get wrong output with a different font. What can I do?

  • the psutils tools caused this problem (see above).
  • With the following command you can bypass the postscript filter
    • lp -o document-format=application/bindlong -dprinter myfile

    • or lp -o document-format=application/bindshort -dprinter myfile

Printing from Linux Notebooks

using cups

Use one of the following two methods to let your local cups communicate with our server. Afterwards you can use cups as described above.

use a local cups-daemon
  • If you want your Cupsd to communicate with the server permanently, just add the line Browsepoll zncups.ifh.de to /etc/cups/cupsd.conf and restart the cups-deamon by typing /etc/init.d/cups restart as root. From now on, the cups-daemon will comunicate with zncups every time cups is started.

  • If you just want cups to communicate with the server for the current session, you can start the cups-polld manually. Normally it is located in /usr/lib/cups/daemon/. You can start it by typing /usr/lib/cups/daemon/cups-polld zncups.ifh.de 631 30 631 as root. If you do so, there is no need to restart the local cups-server. By default, the printer information are lost 5 minutes after stopping the cups-polld.

  • or use the usual "add new printer" dialogue and provide the name of the queue which is the printers name and the IP address of the server
  • or run as root
      lpadmin -p <printer_name> -E -v ipp://zncups.ifh.de/<printer_name>

without local cups-daemon

If you have no local cupsd running, just change the Servername directive in /etc/cups/client.conf to zncups.ifh.de

lpr/lp based printing system

  • If you work with a lpr/lp based subsystem a printcap entry in your /etc/printcap file would probably look like this:
    <printer_name>:\
    :rm=zncups.ifh.de:\
    :rp=<printer_name> 

Known Problems using Cups

  • network trouble or problems on the print server can cause an empty printer setup on the clients
  • psutils and the CUPS postscript filter are incompatible
  • the Acrobat Reader doesn't show full printer (and instances) names on UNIX. You can decide if it is A3, transparency or normal paper queue.

CUPS/Archive/Printing_with_Cups (last edited 2020-05-22 01:39:00 by FabianKrack)