PostScript Module: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
m (header caps)
Line 1: Line 1:
=The PostScript printing module=
The PostScript module is one of two subsystems used to support printing on unix, linux, VMS, and similar operating systems; the other is [[Xprint Module | Xprint]]. This module is based on the printing support from Netscape Communicator 4.x and older versions.
The PostScript module is one of two subsystems used to support printing on unix, linux, VMS, and similar operating systems; the other is [[Xprint Module | Xprint]]. This module is based on the printing support from Netscape Communicator 4.x and older versions.



Revision as of 17:08, 20 December 2005

The PostScript module is one of two subsystems used to support printing on unix, linux, VMS, and similar operating systems; the other is Xprint. This module is based on the printing support from Netscape Communicator 4.x and older versions.

The PostScript module (or PS for short) operates by writing a PostScript document for the print job to a temporary file. This file may then be submitted for printing through lpr or another program, or it can be saved to a permanent filename.

Printer selection

By default, the PS module sets up one print destination, called PostScript/default. Additional printers may be added through one of three methods:

  • If CUPS is installed on the system, then PS will query CUPS for a list of printers. These will appear in the print dialog as CUPS/<name>.
  • PS will check for an environment variable MOZILLA_POSTSCRIPT_PRINTER_LIST. If set, it's interpreted as a space-separated list of printers. In the print dialog these will appear as PostScript/<name>.
  • If MOZILLA_POSTSCRIPT_PRINTER_LIST was not set, then PS will check for a pref print.printer_list. If found, it's handled the same way as MOZILLA_POSTSCRIPT_PRINTER_LIST.

Printing to a CUPS printer

When printing to a CUPS printer (any printer labelled with CUPS in the print dialog), gecko uses the CUPS library to submit print jobs.

Printing to other printers

For printers labelled PostScript in the print dialog (and not on VMS; see below), gecko follows these steps to print:

  1. If not printing to PostScript/Default, create an environment variable MOZ_PRINTER_NAME containing the name of the printer.
  2. Launch the print command with its standard input connected to a pipe. The command comes from the printer properties dialog. On Solaris the default command is lp -c -s ${MOZ_PRINTER_NAME:+'-d '}${MOZ_PRINTER_NAME}; on other systems it's lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}.
  3. Write the text of the print job to the pipe connected to the print command.

Printing on OpenVMS

On VMS, gecko follows these steps to print:

  1. Write the print job to a temporary file.
  2. If not printing to PostScript/Default, create an environment variable MOZ_PRINTER_NAME containing the name of the printer.
  3. Run a command to submit the file for printing. The actual command comes from the printer properties dialog, with the name of the file appended. By default, gecko runs print /delete <name-of-file>.

Printing on VMS is currently broken in gecko 1.8; see bug 246349. Patches are welcome.