filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
161
stars
126
forks
source link
readme
OpenPrinting CUPS Filters v2.0.1 - 2024-08-15
Looking for compile instructions? Read the file "INSTALL"
instead...
INTRODUCTION
CUPS is a standards-based, open-source printing system used by Apple's
Mac OS® and other UNIX®-like operating systems, especially also
Linux. CUPS uses the Internet Printing Protocol ("IPP") and provides
System V and Berkeley command-line interfaces, a web interface, and a
C API to manage printers and print jobs.
This package contains backends, filters, and other software that was
once part of the core CUPS distribution, but during the time when CUPS
was developed at Apple, Apple stopped maintaining these parts as they
were not needed by Mac OS.
In addition it contains more filters and software developed
independently of Apple, especially filters for the PDF-centric
printing workflow introduced by OpenPrinting.
Since CUPS 1.6.0 cups-filters is required for using printer
drivers (and also driverless printing) with CUPS under Linux. This
version of cups-filters is only for CUPS 2.2.2 or newer. Please
use the cups-filters 1.x line for older CUPS versions.
CUPS 3.x has a vastly changed architecture (what we call the New
Architecture for printing) being all-IPP, only supporting driverless
IPP printers and no PPD files and classic CUPS drivers any more. It
will not use external filters any more and so will not need this
package. This package retro-fits the filter functions of
libcupsfilters and libppd to CUPS 2.x.
For compiling and using this package CUPS (2.2.2 or newer),
libcupsfilters 2.x, and libppd are needed. It is highly recommended,
especially if non-PDF printers are used, to have at least one of
Ghostscript (preferred), Poppler, or MuPDF installed.
It also needs gcc (C compiler), automake, autoconf, autopoint, and
libtool. On Debian, Ubuntu, and distributions derived from them you
could also install the "build-essential" package to auto-install most
of these packages.
If Ghostscript is used (via the "gsto..." or the "universal" CUPS
filters), Ghostscript 10.00.0 is required (10.01.0 is highly
recommended) and it has to be built at least with the "pdfwrite",
"ps2write", "cups", "pwgraster", "appleraster", "pclm", "pclm8",
"pdfimage24", "pdfimage8", "pxlcolor", and "pxlmono" output
devices. libcups of CUPS 2.2.2 or newer is required to build
Ghostscript this way.
If you use MuPDF as PDF renderer make sure to use at least version
1.15, as the older versions have bugs and so some files get not
printed correctly.
CUPS, this package, and Ghostscript contain some rudimentary printer
drivers and especially the filters needed for driverless printing
(currently PWG Raster, Apple Raster, PCLm, and PDF output formats, for
printers supporting IPP Everywhere, AirPrint, Wi-Fi Direct, and other
standards). See the links to the Printer Applications below and also
http://www.openprinting.org/drivers/ for a comprehensive set of
printer drivers for Linux.
Most of this is still valid for the current version of cups-filters.
IMAGE PRINTING DEFAULT CHANGED TO "SCALE TO FIT"
Compared to the PostScript-based original CUPS filters there is a
change of defaults: The imagetopdf and imagetoraster filters print in
"print-scaling=fit" or "scale-to-fit" mode (image is scaled to fill
one page but nothing of the image being cut off) by default.
This is done to support photo printing via AirPrint. The photo apps on
Apple's iOS devices send print jobs as JPEG images and do not allow to
set any options like "print-scaling" or the page size. With
"scale-to-fit" mode set by default, the iOS photos come out on one
page, as expected.
To get back to the old behavior, supply one of the options
"print-scaling=none", "nofitplot", "filplot=Off", "nofit-to-page", or
"fit-to-page=Off".
GHOSTSCRIPT RENDERING OF FILLED PATHS
When Ghostscript is rendering PostScript or PDF files into a
raster format the filled paths are ususally rendered with the
any-part-of-pixel method as it is PostScript standard. On
low-resolution printers, like label printers with 203 dpi,
graphics output can get inaccurate and so for example bar codes do
not work any more. This problem can be solved by letting
Ghostscript use the center-of-pixel method.
This can be done by either supplying the option "-o
center-of-pixel" or "-o CenterOfPixel" on the command line when
printing or by adding a "CenterOfPixel" option to the PPD file and
set it to "true", for example by adding the following lines to the
PPD file of the print queue (usually in /etc/cups/ppd/):
This option can be used when the print queue uses the gstoraster
filter.
POSTSCRIPT PRINTING RENDERER AND RESOLUTION SELECTION
If you use CUPS with this package and a PostScript printer then
the included pdftops filter converts the print job data which is
in PDF format into PostScript. By default, the PostScript is
generated with Ghostscript's "ps2write" output device, which
generates a DSC-conforming PostScript with compressed embedded
fonts and compressed page content. This is resource-saving and
leads to fast wire transfer of print jobs to the printer.
Unfortunately, Ghostscript's PostScript output is not compatible
with some printers due to interpreter bugs in the printer and in
addition, processing (by Ghostscript or by the printer's
interpreter) can get very slow with high printing resolutions when
parts of the incoming PDF file are converted to bitmaps if they
contain graphical structures which are not supported by
PostScript. The bitmap problem especially occurs on input files
with transparency, especially also the ones produced by Cairo
(evince and many other GNOME/GTK applications) which unnecessarily
introduces transparency even if the input PDF has no transparency.
Therefore there are two possibilities to configure pdftops at
runtime:
Selection of the renderer: Ghostscript, Poppler, pdftocairo,
Adobe Reader, or MuPDF
Ghostscript has better color management and is generally optimized
more for printing. Poppler produces a PostScript which is
compatible with more buggy built-in PostScript interpreters of
printers and it leads to a somewhat quicker workflow when
graphical structures of the input PDF has to be turned into
bitmaps. Adobe Reader is the PDF renderer from Adobe, the ones who
created PDF and PostScript. pdftocairo is a good choice for the
PDF output of Cairo (for example when printing from evince). It
is less resource-consuming when rasterizing graphical elements
which cannot be represented in PostScript (like
transparency). Note that pdftocairo only supports PDF input using
DeviceRGB, DeviceGray, RGB or sGray and is not capable of
generating PostScript level 1. So its support is only experimental
and distributions should not choose it as default.
The selection is done by the "pdftops-renderer" option, setting it
to "gs", "pdftops", "pdftocairo", "acroread", "mupdf", or "hybrid":
By default, pdftops uses Ghostscript if this does not get changed
at compile time, for example by the Linux distribution vendor.
Hybrid means Ghostscript for most printers, but Poppler's pdftops
for Brother, Minolta, and Konica Minolta. Printer make and model
information comes from the PPD or via the "make-and-model" option.
Limitation of the image rendering resolution
If graphical structures of the incoming PDF file have to be
converted to bitmaps due to limitations of PostScript, the
conversion of the file by pdftops or the rendering by the printer
can get too slow if the bitmap resolution is too high or the
printout quality can degrade if the bitmap resolution is too low.
By default, pdftops tries to find out the actual printing
resolution and sets the resolution for bitmap generation to the
same value. If it cannot find the printing resolution, it uses 300
dpi. It never goes higher than a limit of 1440 dpi. Note that this
default limit can get changed at compile time, for example by the
Linux distribution vendor.
The resolution limit for bitmaps can be changed to a lower or
higher value, or be set to unlimited. This is done by the option
"pdftops-max-image-resolution", setting it to the desired value
(in dpi) or to zero for unlimited. It can be used per-job or as
per-queue default as the "pdftops-renderer" option described
above.
The "pdftops-max-image-resolution" option is ignored when Adobe
Reader is selected as PDF renderer.
POSTSCRIPT PRINTING DEBUG MODE
Sometimes a PostScript printer's interpreter errors, crashes, or
somehow else misbehaves on Ghostscript's output. To find
workarounds (currently we have already workarounds for Brother and
Kyocera) it is much easier to work with uncompressed PostScript.
To get uncompressed PostScript as output, send a job with the
"psdebug" option, with commands like the following:
If you want to send your job out of a desktop application, run
lpoptions -p <printer> -o psdebug
to make "psdebug" a personal default setting for you.
To extract the PostScript output for a developer to analyse it,
clone your print queue to a one which prints into a file:
cupsctl FileDevice=yes
lpadmin -p test -E -v file:/tmp/printout \
-P /etc/cups/ppd/<name of original queue>.ppd
and print into this queue as described above. The PostScript
output is in /tmp/printout after the job has completed.
This option does not change anything if Poppler's pdftops is used
as renderer.
CUPS FILTERS FOR PDF AS STANDARD PRINT JOB FORMAT
Here is documentation from the former CUPS add-on tarball with the
filters for the PDF-based printing workflow: imagetopdf, texttopdf,
pdftopdf, and pdftoraster
NOTE: the texttops filter shipping with this package is a simple
wrapper script for backward compatibility with third-party PPD files
and custom configurations. It is not referred to in the
cupsfilters.convs file and therefore not used by the default
configuration. Direct conversion of text to PostScript is deprecated
in the PDF-based printing workflow. So do not use this filter when
creating new PPD files or custom configurations. The parameters for
this filter are the same as for texttopdf (see below) as the texttops
filter calls the texttopdf filter plus Ghostscript's pdf2ps.
Filters
IMAGETOPDF
INTRODUCTION
This program is "imagetopdf". "imagetopdf" is a CUPS filter which reads
a single image file, converts it into a PDF file and outputs it to stdout.
This program accepts the following image file format;
xbitmap, xpixmap and xwindowdump images are converted into png images by
the "convert" command. Other kinds of image file format can be supported
if the "convert" command support them.
Output PDF file format conforms to PDF version 1.3 specification, and
input image is converted and contained in the output PDF file as a binary
format non-compression image.
"imagetopdf" may outputs multiple pages if the input image exceeds page
printable area.
COMMAND LINE
"imagetopdf" is a CUPS filter, and the command line arguments, environment
variables and configuration files are in accordance with the CUPS filter
interface.
is appended into the PDF dictionary as /Title.
specifies the number of document copies.
is a CUPS option list.
is an input image file name.
When omit the , "imagetopdf" reads an image file from stdin.
3. ENVIRONMENT VARIABLES
This program refers the following environment variable;
PPD: PPD file name of the printer.
4. COMMAND OPTIONS
"imagetopdf" accepts the following CUPS standard options;
fitplot
mirror
PageSize
page-left, page-right, page-bottom, page-top
OutputOrder
Collate
sides
cupsEvenDuplex
position
scaling
ppi
natural-scaling
landscape
orientation-requested
See the CUPS documents for details of these options.
5. KNOWN PROBLEMS
Problem:
PBM and SUN raster images can not be printed.
Solution:
Due to the CUPS libcupsimage library's bug. Update the CUPS on your system.
6. INFORMATION FOR DEVELOPERS
Following information is for developers, not for driver users.
6.1 Options handled by a printer or "imagetopdf"
Following options are handled by a printer or "imagetopdf":
Collate, Copies, Duplex, OutputOrder
Which handles these options depends on following options and attributes:
Collate, Copies, Duplex, OutputOrder, cupsEvenDuplex, cupsManualCopies
"imagetopdf" judges whether a printer can handle these options according to
the followings option settings in a PPD file.
Collate:
If Collate is defined, "imagetopdf" judges the printer supports Collate.
Copies:
If cupsManualCopies is defined as True, "imagetopdf" judges the printer
does not support Copies feature.
Duplex:
If Duplex is defined, "imagetopdf" judges the printer supports Duplex.
If cupsEvenDuplex is True, Number of pages must be even.
OutputOrder:
If OutputOrder is defined, "imagetopdf" judges the printer supports
OutputOrder.
If the printer cannot handle these options, "imagetopdf" handles it.
Following pseudo program describes how "imagetopdf" judges to handle
these options.
Variables
Copies: specified Copies
Duplex: specified Duplex
Collate: specified Collate
OutputOrder: specified OutputOrder
EvenDuplex: specified cupsEvenDuplex
pages: number of pages
number_up: specified number-up
device_copies: Copies passed to the printer
device_duplex: Duplex passed to the printer
device_collate: Collate passed to the printer
device_outputorder: OutputOrder passed to the printer
soft_copies: copies by imagetopdf
```
device_copies = 1;
device_duplex = False;
device_collate = False;
device_outputorder = False;
if (Copies == 1) {
/* Collate is not needed. */
Collate = False;
}
if (!Duplex) {
/* EvenDuplex is not needed */
EvenDuplex = False;
}
if (Copies > 1 && the printer can handle Copies) device_copies = Copies;
if (Duplex && the printer can handle Duplex) {
device_duplex = True;
} else {
/* imagetopdf cannot handle Duplex */
}
if (Collate && the printer can handle Collate) device_collate = True;
if (OutputOrder == Reverse && the printer can handle OutputOrder)
device_outputorder = True;
if (Collate && !device_collate) {
/* The printer cannot handle Collate.
So imagetopdf handle Copies */
device_copies = 1;
}
if (device_copies != Copies /* imagetopdf handle Copies */ && Duplex)
/* Make imagetopdf handle Collate, otherwise both paper side may have
same page */
Collate = True;
device_collate = False;
}
if (Duplex && Collate && !device_collate) {
/* Handle EvenDuplex, otherwise the last page has
the next copy's first page in the other side of the paper. */
EvenDuplex = True;
}
if (Duplex && OutputOrder == Reverse && !device_outputorder) {
/* Handle EvenDuplex, otherwise the first page's other side of paper
is empty. */
EvenDuplex = True;
}
soft_copies = device_copies > 1 ? 1 : Copies;
```
6.2 JCL
When you print PDF files to a PostScript(PS) printer, you can specify
device options in PS. In this case, you can write PS commands in a PPD file
like as follows.
```
*OpenUI *Resolution/Resolution : PickOne
*DefaultResolution: 600
*Resolution 300/300 dpi: "<>setpagedevice"
*Resolution 600/600 dpi: "<>setpagedevice"
*CloseUI: *Resolution
```
However, if options cannot be described in PS file, you can write JCLs
as follows;
```
*JCLOpenUI *JCLFrameBufferSize/Frame Buffer Size: PickOne
*DefaultJCLFrameBufferSize: Letter
*OrderDependency: 20 JCLSetup *JCLFrameBufferSize
*JCLFrameBufferSize Off: '@PJL SET PAGEPROTECT = OFF<0A>'
*JCLFrameBufferSize Letter: '@PJL SET PAGEPROTECT = LTR<0A>'
*JCLFrameBufferSize Legal: '@PJL SET PAGEPROTECT = LGL<0A>'
*JCLCloseUI: *JCLFrameBufferSize
```
Because PDF cannot specify device options in a PDF file, you have to define
all the device options as JCLs.
When a printer does not support PS or PDF, you can use Ghostscript (GS).
In this case, you can specify device options like a PS printer.
If you want to use the same printer and same PPD file for both PDF and PS
printing, when you print a PS file, you can specify that GS handles it,
and when you print a PDF file, you can also specify that PDF filters handle
it in the same PPD file. However in this case, previous methods is not
appropriate to specify device options.
So, "imagetopdf" handles this case as follows;
(In following pseudo program, JCL option is an option specified with JCLOpenUI)
```
if (Both JCLBegin and JCLToPSInterpreter are specified in the PPD file) {
output JCLs that marked JCL options.
}
if (pdftopdfJCLBegin attribute is specified in the PPD file) {
output it's value
}
if (Copies option is specified in the PPD file) {
mark Number of copies specified
} else if (pdftopdfJCLCopies is specified in the PPD file) {
output JCL specified with JCLCopies
}
for (each marked options) {
if (pdftopdfJCL is specified in the PPD file) {
output it's value as a JCL
} else if (pdftopdfJCLBegin attributes is specified in the PPD file) {
output "