pavement

Printing, about

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(Modern CUPS specifications)
m (CUPS)
 
(20 intermediate revisions by one user not shown)
Line 2: Line 2:
  
 
==Protocols==
 
==Protocols==
LPD (Line Printer Daemon) and IPP (Internet Printing Protocol) are printer protocols defined by IETF. LPD is described by RFC 1179 (not as a standard): it uses service port 515. IPP is defined by RFC 8011 and RFC 3510: it uses service port 631. Access control and security features are available on IPP that aren't on LPD. RFC 2569 is a memo on mapping between LPD and IPP.
+
LPD (Line Printer Daemon) and IPP (Internet Printing Protocol) are printer protocols defined by IETF. LPD is described by RFC 1179 (not as a standard): it uses service port 515. IPP is a standard defined by RFC 8011 and RFC 3510: it uses service port 631. Access control and security features are available on IPP that aren't on LPD. RFC 2569 is a memo on mapping between LPD and IPP.
  
 
pdl-datastream on service port 9100 is for proprietary printers and proprietary local network printer servers. This is often used by JetDirect products.
 
pdl-datastream on service port 9100 is for proprietary printers and proprietary local network printer servers. This is often used by JetDirect products.
Line 12: Line 12:
 
LPR is the default with FreeBSD. LPRng is a more advanced implementation of LPR. These two programs use and can alter {{man|printcap|5}}. LPR and LPRng both use the LPD protocol over service port 515.
 
LPR is the default with FreeBSD. LPRng is a more advanced implementation of LPR. These two programs use and can alter {{man|printcap|5}}. LPR and LPRng both use the LPD protocol over service port 515.
  
LPR and LPRng require manual set up through custom shell scripts of filters to convert plain text or other types of data, even between PostScript outputs to PostScript able printers. {{port|print/a2ps}} can simplify this task of converting ASCII to PostScript output. LPR's intended use was for text printing.
+
LPR and LPRng require manual set up through custom shell scripts of filters to convert plain text or other types of data, even between PostScript outputs to PostScript capable printers. {{port|print/a2ps}} can simplify this task of converting ASCII to PostScript output. LPR's intended use was for text printing.
  
LPRng (LPR Next Generation) is an advanced replacement for LPR. It is under the GPL and Artistic licenses. IFHP determines the format and does conversions, including by use of Ghostscript. LPRng takes care of format conversions through its filters, and of PostScript output through Ghostscript. LPRng was designed to be more secure than LPR. LPRng is found at {{port|sysutils/LPRng}}. It uses {{file|printcap}}, {{file|lpd.conf}}, and {{file|lpd.perms}} for configuration.
+
LPRng (LPR Next Generation) is an advanced replacement for LPR. It is under the GPL and Artistic licenses. IFHP is a filter that determines the format and does conversions, including by use of Ghostscript. LPRng takes care of format conversions through its filters, and of PostScript output through Ghostscript. LPRng was designed to be more secure than LPR. LPRng is found at {{port|sysutils/LPRng}}. It uses {{file|printcap}}, {{file|lpd.conf}}, and {{file|lpd.perms}} for configuration.
  
 
lprng in services ({{file|rc.conf}}) requires that lpr and cupsd be disabled. LPR and LPRng daemons can be enabled or disabled through {{file|rc.conf}}. LPR compilation in the world build can be disabled through {{man|src.conf|5}}
 
lprng in services ({{file|rc.conf}}) requires that lpr and cupsd be disabled. LPR and LPRng daemons can be enabled or disabled through {{file|rc.conf}}. LPR compilation in the world build can be disabled through {{man|src.conf|5}}
  
 
===CUPS===
 
===CUPS===
The CUPS framework supports more printers than LPR and LPRng, and it is more advanced. PCL printers are more readily supported under CUPS. CUPS can be administered on the command line, through the web interface, and through a GUI.
+
The Common Unix Printing System (CUPS: {{port|print/cups}}) framework supports more printers than LPR and LPRng, and it is more advanced. PCL printers are more readily supported under CUPS. CUPS can be administered on the command line, through the web interface, and through a GUI.
  
 
The default protocol that CUPS uses is IPP. In addition to IPP, CUPS also has protocol support for: LPD, SMB (Server Message Block) and pdl-datastream. CUPS originally started out over LPD. Samba is only needed for printing on LANs that include Windows computers.
 
The default protocol that CUPS uses is IPP. In addition to IPP, CUPS also has protocol support for: LPD, SMB (Server Message Block) and pdl-datastream. CUPS originally started out over LPD. Samba is only needed for printing on LANs that include Windows computers.
Line 37: Line 37:
  
 
Some programs, such as forks of OpenOffice (such as LibreOffice or Apache OpenOffice) provide their own drivers that output to LPR in place of already configured filters like Ghostscript. Their printing has to be set up independently from an already working CUPS or LPR print configuration.
 
Some programs, such as forks of OpenOffice (such as LibreOffice or Apache OpenOffice) provide their own drivers that output to LPR in place of already configured filters like Ghostscript. Their printing has to be set up independently from an already working CUPS or LPR print configuration.
 +
 +
The Printer Working Group (PWG) intends to offer driverless scanning over IPP. However, there are no IPP scanners and there's no working program from PWG, so SANE is still the de-facto standard for open-source printing. SANE is under GPL, and it is unable to be changed to LGPL by the wishes of its maintainers, because it has multiple contributors.
  
 
==Modern CUPS specifications==
 
==Modern CUPS specifications==
Line 45: Line 47:
 
There are also IPP-Everywhere compliant printers.
 
There are also IPP-Everywhere compliant printers.
  
Airprint is an alternate technology for Apple MacOS and i-products. It uses Apple Raster ('image/urf').
+
Airprint is an alternate technology for Apple MacOS and i-products. It uses Apple Raster ('image/urf'). Mopria is a printer technology to print from Android, which is intended to be used with PAPPL.
  
 
'text/plain' is supported by simple printers. 'application/octet-stream' tells capable printers which format to use. For printers without this capability, the format has to be specified through configuration or through print commands.
 
'text/plain' is supported by simple printers. 'application/octet-stream' tells capable printers which format to use. For printers without this capability, the format has to be specified through configuration or through print commands.
  
 
The WiFi alliance has a printer specification.
 
The WiFi alliance has a printer specification.
 +
 +
Industrial, label, legacy and other specialized printers don't have the capability for these modern printing formats. LPrint is intended for label printers to work with CUPS, and a few are already supported. The PAPPL framework could be the replacement for drivers of legacy, specialty and other printers to work with newer versions of CUPS.
 +
 +
Legacy printers may have an application that addresses their Printer Description Language for use with the newer versions of CUPS. PCL has hp-printer-app, and PostScript has ps-printer-app.
 +
 +
For 3D printers, there are a few formats supported: 3MF, U3D, PRC and PWG compliant G-code. Different versions of PDF have support for either U3D and PRC.
  
 
==Legacy specifications: filters/drivers/PDL's==
 
==Legacy specifications: filters/drivers/PDL's==
Line 64: Line 72:
  
 
===PostScript===
 
===PostScript===
LPR in base, and CUPS from ports perform the same function of receiving PostScript output and sending it to PostScript capable printers. CUPS allows printers that use other PCL's to be used through PostScript via PPD (PostScript Printer Description) conversions.
+
LPR in base, and CUPS from ports perform the same function of receiving PostScript output and sending it to PostScript capable printers. CUPS allows printers that use other PDL's to be used through PostScript via PPD (PostScript Printer Description) conversions. LPR uses filters to convert from Postscript and other formats to a language a printer understands.
  
 
PostScript is the default for both CUPS and Apple. For the most common PDL's: PostScript is considered higher quality than PCL, so more preference is centered around it. There are also very high quality printers that don't use either of these two PDL's.
 
PostScript is the default for both CUPS and Apple. For the most common PDL's: PostScript is considered higher quality than PCL, so more preference is centered around it. There are also very high quality printers that don't use either of these two PDL's.
Line 101: Line 109:
 
* https://docs.freebsd.org/en/articles/cups/
 
* https://docs.freebsd.org/en/articles/cups/
 
* https://www.informit.com/articles/article.aspx?p=167786
 
* https://www.informit.com/articles/article.aspx?p=167786
 +
* https://www.cups.org/blog/2018-06-06-demystifying-cups-development.html
 +
* https://ftp.pwg.org/pub/pwg/liaison/openprinting/presentations/cups-plenary-may-2021.pdf
 +
* https://www.msweet.org/lprint/
 +
* https://www.msweet.org/pappl/
 +
* https://www.pwg.org/3d/index.html
 +
* https://www.pwg.org/ipp/ippguide.html
 +
* https://openprinting.github.io/upcoming-technologies/02-ipp-scan/
 
(some references are out of date, but still have relevance)
 
(some references are out of date, but still have relevance)
  

Latest revision as of 01:35, 28 June 2021

About printing on FreeBSD: comparisons of printing protocols; about filters, Page Description Languages (PDL's) and printer specifications.

Contents

[edit] Protocols

LPD (Line Printer Daemon) and IPP (Internet Printing Protocol) are printer protocols defined by IETF. LPD is described by RFC 1179 (not as a standard): it uses service port 515. IPP is a standard defined by RFC 8011 and RFC 3510: it uses service port 631. Access control and security features are available on IPP that aren't on LPD. RFC 2569 is a memo on mapping between LPD and IPP.

pdl-datastream on service port 9100 is for proprietary printers and proprietary local network printer servers. This is often used by JetDirect products.

Printers can also use SMB (over Samba) as a protocol.

[edit] Comparison of print architectures

[edit] LPR, LPRng

LPR is the default with FreeBSD. LPRng is a more advanced implementation of LPR. These two programs use and can alter printcap(5). LPR and LPRng both use the LPD protocol over service port 515.

LPR and LPRng require manual set up through custom shell scripts of filters to convert plain text or other types of data, even between PostScript outputs to PostScript capable printers. print/a2ps can simplify this task of converting ASCII to PostScript output. LPR's intended use was for text printing.

LPRng (LPR Next Generation) is an advanced replacement for LPR. It is under the GPL and Artistic licenses. IFHP is a filter that determines the format and does conversions, including by use of Ghostscript. LPRng takes care of format conversions through its filters, and of PostScript output through Ghostscript. LPRng was designed to be more secure than LPR. LPRng is found at sysutils/LPRng . It uses printcap, lpd.conf, and lpd.perms for configuration.

lprng in services (rc.conf) requires that lpr and cupsd be disabled. LPR and LPRng daemons can be enabled or disabled through rc.conf. LPR compilation in the world build can be disabled through src.conf(5)

[edit] CUPS

The Common Unix Printing System (CUPS: print/cups ) framework supports more printers than LPR and LPRng, and it is more advanced. PCL printers are more readily supported under CUPS. CUPS can be administered on the command line, through the web interface, and through a GUI.

The default protocol that CUPS uses is IPP. In addition to IPP, CUPS also has protocol support for: LPD, SMB (Server Message Block) and pdl-datastream. CUPS originally started out over LPD. Samba is only needed for printing on LANs that include Windows computers.

CUPS has its own implementation of LPR in under /usr/local/, as opposed to LPR's default location under /usr/. The LPR files that CUPS uses can be set in /usr/local/etc/cups/printcap. On the command line, CUPS uses BSD LPR style commands.

The command cupsctl can adjust settings in cupsd.conf.

CUPS supports encryption for administration and printing, which wasn't available in older versions. Kerberos will be replaced by OAuth and PAM for access control and security by CUPS 3.0.

CUPS is compatible for use with Zeroconf.

This print architecture uses Apache License 2.0. Legacy versions of CUPS were under GPL.

[edit] More

CUPS and LPRng software conflicts so cannot be installed together. LPR and CUPS can coexist, but only one service is needed.

Some programs, such as forks of OpenOffice (such as LibreOffice or Apache OpenOffice) provide their own drivers that output to LPR in place of already configured filters like Ghostscript. Their printing has to be set up independently from an already working CUPS or LPR print configuration.

The Printer Working Group (PWG) intends to offer driverless scanning over IPP. However, there are no IPP scanners and there's no working program from PWG, so SANE is still the de-facto standard for open-source printing. SANE is under GPL, and it is unable to be changed to LGPL by the wishes of its maintainers, because it has multiple contributors.

[edit] Modern CUPS specifications

As of future CUPS version 3.0, legacy drivers and PDL's will no longer be used. CUPS 2.3 already supports modern CUPS replacements for printer drivers.

PWG Raster ('image/pwg-raster'), JPEG ('image/jpeg'), and PDF ('application/pdf') are modern formats directly supported by newer printers. PWG Raster and JPEG formats are supported by most new printers since 2010.

There are also IPP-Everywhere compliant printers.

Airprint is an alternate technology for Apple MacOS and i-products. It uses Apple Raster ('image/urf'). Mopria is a printer technology to print from Android, which is intended to be used with PAPPL.

'text/plain' is supported by simple printers. 'application/octet-stream' tells capable printers which format to use. For printers without this capability, the format has to be specified through configuration or through print commands.

The WiFi alliance has a printer specification.

Industrial, label, legacy and other specialized printers don't have the capability for these modern printing formats. LPrint is intended for label printers to work with CUPS, and a few are already supported. The PAPPL framework could be the replacement for drivers of legacy, specialty and other printers to work with newer versions of CUPS.

Legacy printers may have an application that addresses their Printer Description Language for use with the newer versions of CUPS. PCL has hp-printer-app, and PostScript has ps-printer-app.

For 3D printers, there are a few formats supported: 3MF, U3D, PRC and PWG compliant G-code. Different versions of PDF have support for either U3D and PRC.

[edit] Legacy specifications: filters/drivers/PDL's

Postscript (PS) and PCL (Printer Command Language) are printer languages known as Page Description Languages (PDL's) supported by the majority of printers for interpreting and printing jobs. These two PDLs are alternate models developed by Adobe and HP respectively. PJL is another type of printer language for controlling features. These legacy specifications work up to CUPS version 2.4. Postscript is defined by 'application/postscript', and PCL is defined by 'application/vnd.hp-pcl'.

Many programs simply output data as Postscript. A filter is often needed for different types of output formats (separate from the printer language), even when the printer understands the same printer language as a program's output (such as Postscript). Output formats that need to be converted to a printer language include: dvi, Fortran and Raster.

Filters are useful for different types of output. Carriage returns are different for command line output from Bourne shells, MS DOS, text files and Postscript output. Without the right filters, printers can stair-step or text can otherwise be misaligned.

Printer packaging lists its specs, often: supported PDLs, fonts and graphics formats.

[edit] PCL

ASCII is a printer language which PCL is an extension of.

[edit] PostScript

LPR in base, and CUPS from ports perform the same function of receiving PostScript output and sending it to PostScript capable printers. CUPS allows printers that use other PDL's to be used through PostScript via PPD (PostScript Printer Description) conversions. LPR uses filters to convert from Postscript and other formats to a language a printer understands.

PostScript is the default for both CUPS and Apple. For the most common PDL's: PostScript is considered higher quality than PCL, so more preference is centered around it. There are also very high quality printers that don't use either of these two PDL's.

PostScript printers cost more because of hardware and font license fees from Adobe. However, this company offers PostScript software drivers for free. (Opensource driver software is available as mentioned a few times.) HP computers that have M in the model for Macintosh are PostScript printers (one may want to confirm that the specifications say Postscript).

Conversions for non-PostScript printers rely on PPD's, and filters.

[edit] Conversions

Ghostscript is a substitution for PCL printers to work as if they were PostScript. Ghostscript, Foomatic and other printer suites act as filters on LPR. On CUPS, many of these filters plus Gutenprint are able to provide needed PPD's (Postscript Printer Descriptions) for varying printers. print/foomatic-filters may lack compatibility with CUPS, and it conflicts with a needed print/cups-filters .

LPR is able to output to non-PostScript printers by using Ghostscript's gs as an input filter through printcap. Ghostscript offers a few conversion programs between Postscript and pdf files.

Ghostscript (under AGPL) can convert PostScript outputs to printer languages which specific non-Postscript printers can interpret. In addition to PCL, Ghostscript makes ESC printers functional. LPRng includes Ghostscript for printer language conversion too. Ghostscript can be used with LPR, CUPS, or LPRng

GhostViewer (print/gv ) is a program for viewing Postscript output on the monitor.

[edit] ESC

ESC/P (Epson's developed PDL) printers are used in consumer inkjet printers, as well as dot matrix, receipt, thermal, labeling and barcode printers.

[edit] GDI/WIN

Win(dos) or GDI printers are generally incompatible with BSD's or Linux. Printers that let the software from the computer run them completely are referred to as dumb printers.

[edit] Components

The spool holds printing jobs to be printed in order. Print jobs are held in the /var/spool/ directory.

[edit] References/Further Reading

(some references are out of date, but still have relevance)

Personal tools