GithubHelp home page GithubHelp logo

openprinting / cups-filters Goto Github PK

View Code? Open in Web Editor NEW
155.0 23.0 125.0 245.71 MB

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems

License: Apache License 2.0

Makefile 2.30% Shell 2.25% C 84.76% M4 8.84% Roff 1.85%

cups-filters's Introduction

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.

Report bugs to

https://github.com/OpenPrinting/cups-filters/issues

See the "COPYING", "LICENCE", and "NOTICE" files for legal information. The license is the same as for CUPS, for a maximum of compatibility.

LINKS

cups-filters

The New Architecture of Printing and Scanning

DOCUMENTATION FROM CUPS-FILTERS 1.x

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/):

*OpenUI *CenterOfPixel/Center Of Pixel: PickOne
*OrderDependency: 20 AnySetup *CenterOfPixel
*DefaultCenterOfPixel: true
*CenterOfPixel true/true: ""
*CenterOfPixel false/false: ""
*CloseUI: *CenterOfPixel

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:

  1. 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":

Per-job: lpr -o pdftops-renderer=pdftops ... Per-queue default: lpadmin -p printer -o pdftops-renderer-default=gs Remove default: lpadmin -p printer -R pdftops-renderer-default

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.

  1. 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:

lpr -P <printer> -o psdebug <file>
lp -d <printer> -o psdebug <file>

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

The original filters are from http://sourceforge.jp/projects/opfc/

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

  1. 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;

gif, png, jpeg, tiff, photocd, portable-anymap, portable-bitmap,
portable-graymap, portable-pixmap, sgi-rgb, sun-raster, xbitmap,
xpixmap, xwindowdump

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.

  1. 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.

imagetopdf <job> <user> <title> <num-copies> <options> [<filename>]

"imagetopdf" ignores and .

<title> 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.

  1. ENVIRONMENT VARIABLES

This program refers the following environment variable;

PPD: PPD file name of the printer.

  1. 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.

  1. 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.

  1. 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: "<</HWResolution[300 300]>>setpagedevice"
*Resolution 600/600 dpi: "<</HWResolution[600 600]>>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<marked option's name> is specified in the PPD file) {
	output it's value as a JCL
    } else if (pdftopdfJCLBegin attributes is specified in the PPD file) {
	output "<option's name>=<marked choice>;" as a JCL
    }
}
output NEWLINE

Thus, if you want to use both PDF filters and GS by single PPD file, what you should do is to add the following line in the PPD file;

*pdftopdfJCLBegin: "pdfto... jobInfo:"

Replace "pdfto..." by the name of the actual filter to be called after pdftopdf.

Note: If you specify JCLBegin, you have to specify JCLToPSInterpreter as well.

Note: When you need to specify the value which is different from the choosen value based on the PPD into the jobInfo, you have to specify the values with the key started by "pdftopdfJCL" string.

For example, if the page size is defined in a PPD file as following;

  *OpenUI *PageSize/Page Size: PickOne
  *DefaultPageSize: A4
  *PageSize A4/A4:
  *PageSize Letter/US Letter:
  *CloseUI: *PageSize

if you choose the page size "Letter", the string "PageSize=Letter;" is added to jobInfo. On the other hand, if the driver requires the different value for the "Letter" size, for instance driver requires "PS=LT;" instead of "PageSize=Letter;" as the jobInfo value, the PPD file has to be defined as following;

  *OpenUI *PageSize/Page Size: PickOne
  *DefaultPageSize: A4
  *PageSize A4/A4:
  *pdftopdfJCLPageSize A4/A4: "PS=A4;"
  *PageSize Letter/US Letter:
  *pdftopdfJCLPageSize Letter/US Letter: "PS=LT;"
  *CloseUI: *PageSize

6.3 Temporally files location

"imagetopdf" creates temporally files if needed. Temporary files are created in the location specified by TMPDIR environment variable. Default location is "/tmp".

PDFTOPDF

The pdftopdf filter depends on libqpdf to read and write PDF files.

It replaces and imitates the pstops filter in the PDF-based workflow. A similar filter (which can serve as behavior reference) is called "cgpdftopdf" in OS X (not open source).

Command line

pdftopdf follows the usual CUPS filter calling conventions, i.e.

pdftopdf <job> <user> <title> <num-copies> <options> [<filename>]

together with the environment variables "PPD" and "CLASSIFICATION".

When omitting , "pdftopdf" reads a PDF file from stdin. Internally this will write the data to a temporary file, because the PDF format cannot be processed in a streaming fashion.

are delimited by space; boolean type CUPS options can be set by only adding the option key, other types are provided as pairs of key and value, =.

pdftopdf processes the following standard command-line and/or PPD options:

Copies      # ppd will only override, when commandline parameter was 1
fitplot / fit-to-page / ipp-attribute-fidelity
landscape / orientation-requested
PageSize / page-size / MediaSize / media-size
page-left / page-right / page-bottom / page-top
media-top-margin / media-left-margin / media-right-margin /
    media-bottom-margin
Duplex / JCLDuplex / EFDuplex / JD03Duplex / sides
number-up / number-up-layout
page-border
OutputOrder / OutputBin / DefaultOutputOrder / page-delivery
page-label
page-set
page-ranges
MirrorPrint / mirror
emit-jcl
position
Collate / multiple-document-handling / sheet-collate
cupsEvenDuplex
cupsManualCopies  # via ppd

Additional (non-standard) options

  1. Booklet printing

    booklet=Off/On/Shuffle-Only

"On" also tries to set DuplexTumble (two-sided-short-edge) and forces number-up=2

booklet-signature=(multiple of 4, or default: -1 to use "all pages")
  1. Page autorotate

pdftopdf automatically rotates pages to the same orientation, instead of (e.g. fitplot) scaling them down unrotated. This behavier can be controlled by

pdfAutorotate / nopdfAutorotate

Specifically, if a PDF file contains pages with page width greater than page height (a landscape page), such pages are automatically rotated anticlockwise by 90 degrees, unless the PPD file specifies "*LandscapeOrientation: Minus90". In this case, clockwise rotation is used. To turn off the feature on a job-by-job basis use

lp -d <print_queue_name> -o nopdfAutorotate <document>

On a per-queue basis use

-o nopdfAutorotate-default

as an option to lpadmin.

When the 'landscape' or 'orientation-requested=4' (or =5) option of CUPS is given, the pdfAutorotate processing will adjust and accordingly rotate the non-landscape pages are rotated instead.

Note: Some pages might end up 180 degree rotated (instead of 0 degree). Those should probably be rotated manually before binding the pages together.

  1. Method of flattening interactive PDF forms and annotations.

Some PDF files (like application forms) contain interactive forms which the user can fill in inside a PDF viewer like evince. The filled in data is not integrated in each page of the PDF file but stored in an extra layer. Due to this the data gets lost when applying manipulations like scaling or N-up to the pages. To prevent the loss of the data pdftopdf flattens the form before doing the manipulations. This means the PDF will be converted into a static PDF file with the data being integral part of the pages.

The same flattening is needed for annotations in PDF files.

By default the actual flattening work is done by QPDF, as QPDF is also doing everything else in pdftopdf. This way no external utilities need to be called and so extra piping between processes and extra PDF interpreter runs are avoided which makes the filtering process faster.

As we did not test the new QPDF-based form-flattening with thousands of PDF files yet and it has not been available to actual users yet it is possible that there are still some bugs. To give users a possibility to work around possible bugs in QPDF's form flattening, we have introduced an option to get back to the old flattening by the external tools pdftocairo or Ghostscript.

The selection of the method is done by the "pdftopdf-form-flattening" option, setting it to "auto", "qpdf", "pdftocairo", "ghostscript", "gs", "internal" or "external":

Per-job: lpr -o pdftopdf-form-flattening=pdftocairo ... Per-queue default: lpadmin -p printer -o pdftopdf-form-flattening-default=gs Remove default: lpadmin -p printer -R pdftopdf-form-flattening-default

By default, pdftopdf uses QPDF if the option is not supplied, also the settings "auto" and "internal" make QPDF being used. "external" auto-selects from the two external utilities, trying pdftocairo at first and on failure Ghostscript. If the selected utility fails, the form stays unflattened and so the filled in data will possibly not get printed.

Native PDF Printer / JCL Support

Note that for most modern native PDF printers JCL is not needed any more as they are controlled via IPP. For these the PPD files get auto-generated by the support of CUPS and cups-filters for driverless IPP printing.

pdftopdf will emit JCL when provided with a PPD file that includes the "*JCLToPDFInterpreter:" keyword.

This enables for hardware copy generation and device collate; e.g. with PJL:

*JCLBegin:           "<1B>%-12345X@PJL JOB<0A>"
*JCLToPDFInterpreter: "@PJL ENTER LANGUAGE = PDF <0A>"
*JCLEnd:             "<1B>%-12345X@PJL EOJ <0A><1B>%-12345X"

For each marked option, the prefixed "pdftopdfJCL" keywords can also be used to send raw JCL strings for that option. These keywords also include *pdftopdfJCLBegin and *pdftopdfJCLCopies, This allows the use of the same PPD for PDF- and PS-based workflows, as pdftopdfJCL... will not be read in the PS case.

When the PPD contains the "Copies" keyword, pdftopdf will detect the use of PJL and has special code which adds "@PJL SET COPIES=...", or "@PJL SET QTY=...", respectively.

Other JCL code can be injected via "*JCLOpenUI: ..." ... "*JCLCloseUI: ...".

Special PDF comments

pdftopdf adds comments to the pdf preamble that might esp. be of use to subsequent filters, e.g.

% This file was generated by pdftopdf %%PDFTOPDFNumCopies : 1 %%PDFTOPDFCollate : false

The "NumCopies" and "Collate" values refer to the expected device/hardware copies, i.e. when pdftopdf's soft-copy generation did not handle this options.

Limitations

pdftopdf does not support functions that are not related to printing features, including interactive features and document interchange features. Many of these operators and sections are just ignored. Some of these may be output, but those functions are not assured.

Known issues
  • Borders, esp. in the "number-up=1 fitplot=false"-case might be drawn at incorrect locations.

  • JCL documentation is sparse. The imagetopdf or old pdftopdf documentation contains a tad more information.

  • Missing AcroForm-content might surprise users printing PDF files directly / from the command-line (see the Limitations section, above).

TEXTTOPDF

This implements a texttopdf filter, and is derived from cups' texttops.

To configure
  • texttopdf uses CUPS_DATADIR/charset/pdf.utf-8 for font configuration (when utf-8 was requested as charset). The font names given there are used as fontconfig selectors; the best matching font, that is both monospaced and in a supported format (TTC, TTF or OTF) will then be used.

  • As a special exception, all fontnames that start with a '.' or '/' are considered filenames, and fontconfig is skipped; the name is used directly for loading the font file.

  • Implementation note: TrueType Collections (.TTC) are internally handled by appending '/' and the index of the font inside the collection to the filename (e.g. to use the second font of uming.ttc, the filename uming.ttc/1 must be given to the fontembed-library). By appending the index-field returned from fontconfig, this is completely transparent to the user (but currently not widely tested).

  • You may look at the two examples: pdf.utf-8.simple and pdf.utf-8.heavy.

To use

The filter is called just like any other cups filter. Have a look at test.sh for example.

Known Issues
  • Text extraction does not work (at least for pdftotext from xpdf) for the resulting pdfs.

  • OTF(CFF) embedding currently does not subset the fonts.

  • Text wrapping in pretty-printing mode does not respect double-wide characters (CJK), and thus produce wrong results (wrap too late) for lines where they occur. The fix is not trivial, since all the pretty-printing processing is done without knowledge of / prior to the font configuration (which is where single or double width code-ranges are specified).

  • The hebrew example in test5.pdf shows one of our limitations: Compose glyphs are not composed with the primary glyph but printed as separate glyphs.

Further Info

Font embedding is handled by libfontembed in the cupsfilters/fontembed subdirectory.

Please report all bugs to

https://github.com/OpenPrinting/cups-filters/issues

PDFTORASTER

1. INTRODUCTION

"pdftoraster" is a filter for CUPS. It reads PDF files, convert it and output CUPS raster.

"pdftoraster" does not support functions that are not related to printing features, including interactive features and document interchange features. Many of these operators and sections are just ignored. Some of these may be output, but those functions are not assured. Encryption feature is not supported.

2. COMMAND LINE

"pdftoraster" is a CUPS filter, and the command line arguments, environment variables and configuration files are in accordance with the CUPS filter interface.

pdftoraster <job> <user> <title> <num-copies> <options> [<filename>]

"pdftoraster" ignores and .

<title> is appended into the PDF dictionary as /Title. specifies the number of document copies. is a CUPS option list. is an input PDF file name.

When omit the , "pdftoraster" reads a PDF file from the stdin, and save it as a temporary file.

3. ENVIRONMENT VARIABLES

This program refers the following environment variable;

PPD: PPD file name of the printer.

4. COMMAND OPTIONS

See CUPS documents for details.

5. INFORMATION FOR DEVELOPERS

Following information is for developers, not for driver users.

5.1 Options handled by a printer or "pdftoraster"

"pdftopdf" outputs the following special comments from the 4th line in the created PDF data.

%%PDFTOPDFNumCopies : <copies> --- <copies> specified Number of Copies
%%PDFTOPDFCollate : <collate> --- <collate> is true or false

"pdftoraster" overrides the command line options by above two option's values.

5.2 Temporally files location

"pdftoraster" creates temporally files if needed. Temporary files are created in the location specified by TMPDIR environment variable. Default location is "/tmp".

PCLMTORASTER

1. INTRODUCTION

"pclmtoraster" is a filter for pclm and raster-only pdf files. It reads the raster graphics from each page using the QPDF API and converts it to CUPS/PWG Raster. This filter supports all PCLm files. PDF files with single page bitmap for each page and one of the following colorspaces with 8 Bits-per-component are supported DeviceGray, DeviceRGB and DeviceCMYK.

2. ENVIRONMENT VARIABLES

This program refers the following environment variable;

PPD:  PPD file name of the printer.
3. COMMAND OPTIONS

Bi-Level output

print-color-mode=bi-level

Use "bi-level" color mode to apply threshold dithering for 1 bit B/W outputs. By default, ordered dithering is used.

For other options, see CUPS documents for more details.

4. INFORMATION FOR DEVELOPERS

Following information is for developers, not for filter users.

4.1 Temporary files location

"pclmtoraster" creates temporary files if needed. Temporary files are created in the location specified by TMPDIR environment variable. Default location is "/tmp".

TEXTTOTEXT

This is a special filter for text-only printers (e. g. line printers, daisy-wheel printers, POS printers, ...) or for using printers in their text mode (e. g. dot-matrix printers or otherwise unsupported printers). It takes plain text (UTF-8-encoded as this is standard with CUPS) and not PDF as input.

The texttotext filter replaces the former textonly filter.

It is for the following use cases:

  • Using text-only printers, like line printers or daisy-wheel printers. Note that only text can get printed in the way the printer is designed. No support for graphics printing tricks like ASCII art or printing pixels with the period character.

  • Fast and less resource-consuming text printing with dot-matrix printers using the printer's text mode instead of converting the text to PDF and printing the PDF in the printer's graphics mode, which is slow, loud, and consumes much more ink.

  • POS printing. POS printers often print only text on roll paper. This filter has a non-paginated mode which prints continuously, ignoring page height definitions.

The filter has the following features:

  • Conversion of UTF-8 to most printer's encodings.

  • To each page size a number of lines and columns is assigned, after that you only need to select the size of the paper in use.

  • At end of page you can optionally send a Form Feed or let the filter fill up the rest of the page with blank lines.

  • New lines can be initiated by Line Feed, Carriage Return, or both.

  • Adjustable margins.

  • Adjustable width for tab stops.

  • Pagination can be turned off for roll paper or continuous printing in general.

  • Wrapping or truncation of long lines

  • Support for most of CUPS' page management options (only with pagination turned on): page-ranges, page-set, output-order, collate, multiple copies.

Setting up the printer

In the printer setup tool select the "Generic Text-Only Printer" (with lpadmin use "-m drv:///cupsfilters.drv/textonly.ppd"), then under the "Installable Options" adjust the following:

  • Which page sizes to use and how many lines and columns the printer is capable to print on them. The default setting for lines and columns assume 6 lines per inch and 10 columns per inch.

  • Whether to send a Form Feed character after each page. Sending a Form Feed is highly recommended to get the content of each page exactly onto the desired sheet. If the printer does not support Form Feed characters, turn them off and make sure that you have adjusted the correct number of lines for each page size, as the printer is advancing pages by filling up the rest of the paper with blank lines.

  • How the printer advancs to a new line. Most printers require both Crriage Return and Line Feed (the DOS/Windows standard), but some would also work with either Carriage Return or Line Feed.

  • The printer's encoding: Most text and dot-matrix printers (usually older devices) do not understand CUPS' standard encoding UTF-8 but instead, the use a simpler encoding (where each character is represented by one byte). ASCII should always work, but does not support letters with accents. So check the printer's manual what is supported. You cannot only use the encodings suggested by the PPD file, but any one-byte-per-character encoding which the "iconv" utility supports (see "iconv --list" for a list of encodings).

Also note that text-only and dot-matrix printers often have a DIP switch block which allows for some hardware configuration, like newline characters, length of page, input encoding, ...

Options of the texttotext filter:

To be usually used when sending a job:

PageSize: Paper format to be used. Make sure that the number of lines and columns printable on each paper size are correctly adjusted with the appropriate setup option. The page height is ignore when pagination is turned off. Possible values: Letter, Legal, Tabloid, Ledger, A4, A3, FanFoldGerman, FanFoldGermanLegal, 11x14Rotated, LegalRotated, Custom1, Custom2, Custom3

OverLongLines: What to do with lines longer that the width of the page: Truncate: Simply drop the extra characters; WrapAtWidth (default): Continue the line in the next line on the paper; WordWrap: As WrapAtWidth, but do not cut in the middle of a word.

TabWidth: Width of a tab stop. Can be any positive number.

Pagination: On: Text is divided in pages depending on the page size selection, with each page having the user-selected margins, recommended for sheet paper; Off: Text is printed continuously, ignoring page breaks and the height and upper and lower margins of the destination page size, recommended for roll paper, POS, long lists on continuous paper, ... Note that with pagination turned off, multiple copies, collate, page-ranges, page-set, and output-order are not supported and therefore ignored.

page-left, page-right, page-top, page-bottom: Width of the margins left blank, counted in lines or columns. Top and bottom margins are ignored when pagination is turned off. Can be any positive number or zero for no margin.

To be usually used when setting up the printer:

PrinterEncoding: The printer's character encoding (code page). Any encoding which the iconv utility can generate (see "iconv --list") and which uses only one byte per character can be used. This should support practically any printer which is capable of printing text. ASCII is the default setting. See the printer's manual for the correct encoding to use.

NewlineCharacters: The characters sent on the end of a line, LineFeed (LF), Crriage Return (CR), or both Carriage Return and Line Feed (CRLF). Default is CRLF as most printers require this.

SendFF: On: Send a Form Feed after each page, so that printer changes to the next sheet. Off: Do not send Form Feeds. To advance to the next page blank lines are printed to fill up the page (requires the number of limes for the selected page size correctly being set). When pagination is off, Form Feeds are never sent.

LetterAvailable, LegalAvailable, TabloidAvailable, LedgerAvailable, A4Available, A3Available, FanFoldGermanAvailable, FanFoldGermanLegalAvailable, 11x14RotatedAvailable, LegalRotatedAvailable, Custom1Available, Custom2Available, Custom3Available: On: Paper of this size is available; Off: This paper size is not available.

LetterNumLines, LegalNumLines, TabloidNumLines, LedgerNumLines, A4NumLines, A3NumLines, FanFoldGermanNumLines, FanFoldGermanLegalNumLines, 11x14RotatedNumLines, LegalRotatedNumLines, Custom1NumLines, Custom2NumLines, Custom3NumLines: Maximum number of text lines fitting on the paper size. Default value is selected assuming 6 lines per inch. Can be any positive number.

LetterNumColumns, LegalNumColumns, TabloidNumColumns, LedgerNumColumns, A4NumColumns, A3NumColumns, FanFoldGermanNumColumns, FanFoldGermanLegalNumColumns, 11x14RotatedNumColumns, LegalRotatedNumColumns, Custom1NumColumns, Custom2NumColumns, Custom3NumColumns: Maximum number of columns (characters) fitting on the paper size. Default value is selected assuming 10 characters per inch. Can be any positive number.

Standard CUPS options supported:

page-ranges, page set, output-order, collate

Note that these options and multiple copies are ignored when pagination is turned off.

BEH - Backend Error Handler wrapper backend

A wrapper for CUPS backends to make error handling more configurable

Usually, if a CUPS backend exits with an error status other than zero (for example if a printer is not turned on or not reachable on the network), CUPS disables the print queue and one can only print again if a system administrator re-enables the queue manually. Even restarting CUPS (or rebooting) does not re-enable disabled queues.

For system administrators this can get annoying, for newbie users who are not aware of this problem it looks like that CUPS is severely broken. They remove and re-install print queues, getting on the nerves of distro install support, people, or even switch back to a proprietary operating system.

Nowadays CUPS allows some configurability to avoid this, setting the Error Policy to "retry-job", but this does not allow to retry for infinitely many times and generally does not allow to change the number of repetitions. It is also not possible to simply drop the job without disabling the queue when CUPS gives up repeating the job.

This script makes the handling of such backend errors more configurable, so that the problem can easily be worked around. The new possibilities are:

  • Let queues simply not being disabled. Simple approach, but job gets lost.

  • Repeat a given number of times.

  • Repeat infinitely often, until the job gets finally through. This is the standard of LPRng, and it eliminates loss of the job.

  • The interval between two attempts to run the backend can also be configured.

  • Configuration is done independently for each print queue. So local printers and network printers can be treated differently.

Usage:

Activate "beh" for your print queue(s) with command(s) like this:

lpadmin -p <queue name> -E -v beh:/<dd>/<att>/<delay>/<originaluri>

with

<queue name>:     The name of your print queue
<dd>:             Don't Disable, if "1", beh always exits with zero
                  status, so the queue gets never disabled when the
                  original backend exits with an error. "0" carries
                  the error status of the last call of the backend
                  (after <att> retries) on to CUPS, so the queue
                  usually gets disabled.
<att>:            Attempts, number of attempts to recall the backend
                  in case of an error. "0" means infinite retries. In
                  this case <dd> gets meaningless.
<delay>:          Delay between two attempts to call the beckend, to
                  be given in seconds and as an integer number.
                  Meaningless if <att> is one.
<originaluri>:    The original URI, which your queue had before. Can 
                  be determined with "lpstat -v".

All parameters, especially,

, , and have always to be specified, even if one of them is meaningless due to the setting of the others.

beh works with every backend except the "hp" backend of HPLIP, as the "hp" backend repeats failed jobs by itself.

Example URIs:

beh:/1/3/5/socket://printer:9100

  On the network printer with host name "printer" it is tried to
  access 3 times with 5 second delays between the attempts. If the job
  still fails, the queue is not disabled (and the job discarded).

beh:/0/10/60/socket://printer:9100

  Retry 10 times in one minute intervals, disable the queue when still
  not succeeding.

beh:/1/0/60/usb://Brother/HL-5040%20series

  On a Brother HL-5040 on the USB try infinitely often until the
  printer comes back, in intervals of one minute. This way the job
  does not get lost when the printer is turned off and one can
  intendedly delay printing by simply switching off the printer. The
  ideal configuration for desktop printers and/or home users.

Originally this backend was written in Perl and part of the foomatic-filters package. It was not overtaken into cups-filters together with foomatic-rip to avoid the introduction of a dependency on Perl. Now it has been re-written in C and so it can be part of cups-filters without introducing new dependencies.

cups-filters's People

Contributors

adammajer avatar bhavna2020 avatar bmasonrh avatar casantos avatar deepak0405 avatar dheeraj135 avatar dipanshu231099 avatar eli-schwartz avatar g0hl1n avatar ivo-s avatar jailuthra1 avatar jhcloos avatar jpopelka avatar jsimon383 avatar lynxchaus avatar mohitmo avatar nidhijainpnp avatar pranjanpr avatar pranshukharkwal avatar sahilarora535 avatar smilingthax avatar stefanbruens avatar sthibaul avatar surajkulriya avatar tanmayanand44 avatar tillkamppeter avatar twaugh avatar vermamohit13 avatar vikrantmalik051 avatar zdohnal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cups-filters's Issues

If I want to print 2 pages on 1. But it prints the 2 pages in the size of 4 pages

Hi,

im using cups 1.7.5 on a pi3.
It worked great, but since 2 weeks i got this issue.

I want to print 2 pages on 1 page.
But the result is, that the 2 pages have the size, like when i would like to print 4 pages on 1.
So each page has not 50% size on the page, it has 25%.

If I just print one page on one page it works great.
If I connect the printer to my pc, it also works with 2 on 1 .

I rebooted and of course reinstalled my printer. No change.
The settings in word are correct or in the chrome browser.

So there must be an issue with cups.

Any ideas how to solve it ?

Add a simple "fill page" scaling option to imagetoraster and pdftopdf (print-scaling=fill)

Imagetoraster, by default, scales the input image to fill the output page, while respecting the image's aspect ratio.

Unless the input and output aspect ratios are a near-perfect match, this often results in uneven borders/margins, or on full-bleed printers, unsightly white lines on one or more edges, and there is no simple way to avoid this without a-priori knowledge of the printer's native capabilities and using that in a pre-printing "filter" crop the image to the correct aspect ratio.

What I'd like to see is another scaling option that will scale the image's shorter dimension to match the printer's shorter dimension, then crop the excess off the longer dimension. By default we would center the image in the page, but the "position" option could be used to change that.

This is the same idea behind Gutenprint's 'StpiShrinkOutput=Crop' option, but that feature is useless in a CUPS printing flow because imagetoraster generates a raster that already fits the aspect ratio.

On the surface this seems like it would be fairly straightforward to implement (given what imagetoraster already can accomplish), so if I bang this out, is it (in principle) something that would be accepted into cups-filters?

Adobe Reader comments not getting printed out?

Hi all,

I'm not sure if this is the best place to ask? Sorry in advance if it is not.

I've set up a Raspberry Pi to print some drawings that are in pdf format with a shell script using the 'lp' command. To make sure that the drawings don't get clipped off the side of the page I added the option '-o fit-to-page'

Some of these pdf's have comments added to them using adobe reader. If I use the '-o fit-to-page' option the comments do not get printed out but if I don't add the '-o fit-to-page' option the comments do get printed out?

Is there any other way to make sure that the printed pdf will fit to the page and that the comments will get printed out too?

@michaelrsweet suggested that the problem might be with the cups-filter and not cups itself.

Here is the link to the original Issue raised on the cups page - apple/cups#5160

Thanks for your help.

cups-browsed crashed in update_cups_queues

cups-browsed crashed when restarted by systemctl restart cups (when cups-browsed was running). See attatched file.
I have Fedora 29 with cups-2.2.10 and cups-filters-1.21.5, build rpm packages myself from source, based on the latest Fedora packages from koji (but with newer source from github).

cups-browsed-crashed.txt

LaserWriter 4/600 PS prints blank pages when rendered by GhostScript

The Apple LaserWriter 4/600 PS seems to suffer from the same bug in its PostScript interpreter as the Apple LaserWriter 12/640 PS does: When GhostScript is used to render the .ps files this results in empty pages printed. For the latter printer this has been fixed by a workaround in cups-filters:
http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/revision/7449 .
Would it be possible to also fix this for the 4/600 PS? For now I've done it manually by adding "Option pdftops-renderer pdftops" to /etc/cups/printers.conf as described at https://bugzilla.redhat.com/show_bug.cgi?id=1304869#c12 and it's working fine.

I wonder whether the Personal LaserWriter 320, Color LaserWriter 12/600 PS, Color LaserWriter 12/660 PS, and LaserWriter 16/600 PS suffer from the same bug. But I can't verify as I don't have access to any of these.

gstoraster calls gs with "-dPARANOIDSAFER" and this causes cups to state "Filter failed"

Hi,
I'm running an up-to-date Arch Linux box with...

kernel 4.18.5
cups 2.2.8
libcups 2.2.8
cups-filters 1.21.1
ghostscript 9.23

My HP LaserJet Pro P1102 works ok with hplip 3.18.6, every job gets completed, but cups holds every job with a "Filter failed" message since gs, called by gstoraster, throws an error. Here are the relevant lines from /var/log/cups/error_log

D [02/Sep/2018:14:24:02 +0200] [Job 18] 3 filters for job:
D [02/Sep/2018:14:24:02 +0200] [Job 18] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [02/Sep/2018:14:24:02 +0200] [Job 18] gstoraster (application/vnd.cups-pdf to application/vnd.cups-raster, cost 99)
D [02/Sep/2018:14:24:02 +0200] [Job 18] hpcups (application/vnd.cups-raster to printer/Stampante_che_funziona, cost 0)

D [02/Sep/2018:14:24:03 +0200] [Job 18] Ghostscript command line: gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -sMediaType=Plain -sOutputType=0 -r600x600 -dMediaPosition=7 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dcupsBitsPerColor=1 -dcupsColorOrder=0 -dcupsColorSpace=3 -dcupsRowCount=1 -dcupsRowStep=2 -dcupsInteger0=2 -scupsPageSizeName=Letter -I/usr/share/cups/fonts -c \'<</.HWMargins[12.000000 12.000000 12.000000 12.000000] /Margins[0 0]>>setpagedevice\' -f -_

D [02/Sep/2018:14:24:03 +0200] [Job 18] Error: /invalidfileaccess in --run--
D [02/Sep/2018:14:24:03 +0200] [Job 18] Operand stack:
D [02/Sep/2018:14:24:03 +0200] [Job 18] true   (/var/spool/cups/tmp/gs_FzErtn)
D [02/Sep/2018:14:24:03 +0200] [Job 18] Execution stack:
D [02/Sep/2018:14:24:03 +0200] [Job 18] %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2015   2   3   %oparray_pop   2014   2   3   %oparray_pop   1998   2   3   %oparray_pop
D [02/Sep/2018:14:24:03 +0200] [Job 18] Dictionary stack:
D [02/Sep/2018:14:24:03 +0200] [Job 18] --dict:1001/1684(ro)(G)--   --dict:1/20(G)--   --dict:78/200(L)--
D [02/Sep/2018:14:24:03 +0200] [Job 18] Current allocation mode is local
D [02/Sep/2018:14:24:03 +0200] [Job 18] Last OS error: No such file or directory
D [02/Sep/2018:14:24:03 +0200] [Job 18] GPL Ghostscript 9.23: Unrecoverable error, exit code 1
D [02/Sep/2018:14:24:03 +0200] [Job 18] Rendering completed

By testing from terminal the gs command above, I've seen that only by omitting the "-dPARANOIDSAFER" option or replacing it with "-dNOSAFER" the command doesn't throw the error (with "-dSAFER" it does, and ghostscript devs plan to set "-dSAFER" as a default sometimes in the future).
Just to test, I then edited the gstoraster binary with an hex editor replacing "-dPARANOIDSAFER" with "-dNOSAFER" and now gs exits with no error and cups doesn't hold the jobs complaining about "Filter failed".

Can't add Canon MG4120 anymore (cups-filters 1.20.0)

I use Print Setting (system-config-printer) in order to add printers.

When I try to add my printer by automatic detection, it just fails with "server-error-internal-error". Normally, it should add my printer and use driverless for printing. This GUI tool always chooses driverless by default when you use automatic detection; it doesn't let you choose between driverless and something else.

It worked perfectly with previous of cups-filters, including 1.18.0 and 1.19.0. I got this issue when I updated to 1.20.0. I could add my printer and use driverless for it with previous versions of cups-filters.

A workaround I found in order to add my printer with system-config-printer is to manually add the printer, then manually select Gutenprint. Trying to add the printer manually with driverless instead of Gutenprint results in the same error I get when I try to add it by automatic detection.

Trying to add the printer with the Web interface (localhost:631) using driverless ends up with an error too : "unable to add error : unable to copy PPD file." However, adding the printer with the Web interface using Gutenprint works fine.

Here's a typical log output from /var/log/cups/error_log I get when I try to add my printer with driverless in general.

E [04/Feb/2018:20:58:30 -0500] [cups-deviced] PID 5959 (gutenprint52+usb) stopped with status 1!
E [04/Feb/2018:20:58:44 -0500] [CGI] Unable to create PPD file: Printer does not support required IPP attributes or document formats.
E [04/Feb/2018:20:58:47 -0500] [CGI] Unable to create PPD file: Printer does not support required IPP attributes or document formats.
E [04/Feb/2018:20:58:47 -0500] copy_model: empty PPD file
E [04/Feb/2018:20:58:47 -0500] [Client 118] Returning IPP server-error-internal-error for CUPS-Add-Modify-Printer (ipp://localhost/printers/Canon-MG4100-series) from localhost
E [04/Feb/2018:20:58:47 -0500] [CGI] Unable to create PPD file: Printer does not support required IPP attributes or document formats.
E [04/Feb/2018:20:58:47 -0500] copy_model: empty PPD file
E [04/Feb/2018:20:58:47 -0500] [Client 122] Returning IPP server-error-internal-error for CUPS-Add-Modify-Printer (ipp://localhost/printers/Canon-MG4100-series) from localhost

Hope you can do something about it.

Reported about the issue on Manjaro forum
https://forum.manjaro.org/t/stable-update-2018-02-03-kernels-libreoffice-browsers-thunderbird-php-haskell/39663/68
https://forum.manjaro.org/t/testing-update-2018-02-08-kernels-browsers-plasma-gcc-nvidia-systemd/40022/29
https://forum.manjaro.org/t/testing-update-2018-02-15-kernels-firefox-dev-bluez-haskell-python/40450/13

My config
Manjaro Cinnamon 17.1.5 (Testing branch, issue noticed on Stable branch too)
Canon Pixma MG4120 wireless printer (using Avahi for mDNS zeroconf and service discovery, which is compatible with my printer for Wi-Fi printing)
CUPS 2.2.6
cups-filters 1.20.0 (worked fine with previous version such as 1.18.0 and 1.19.0)
system-config-printer 1.5.11 (had the same issue with 1.5.9)

cups-browsed doesn't automatically detect all printers in LAN without BrowsePoll

Hi Till,

I have rather question than maybe issue about cups-browsed functionality - should cups-browsed be able to discover and create local queues for all printers in LAN, without need of setting 'BrowsePoll' option? Like all network IPP printers, USB printers, CUPS remote queues will be discovered at the start of cups-browsed without changing cups-browsed.conf?
Because I can only get my remote cups queues when I set 'BrowsePoll' to my server. But it is written in cups-browsed.conf that when no 'Browse...' options are used, cups-browsed will create print queues for all printers in local network.
I have cups-2.2.4 installed and cups-filters-1.16.1.

jobs sent to remote unshared printer stuck in "held since <date>" with no indication of authorization problem

(I thought I had submitted this issue but I don't see it in your list; apologies if it shows up twice)

I just upgraded cups and cups-filters on my laptop and on my desktop. The desktop has a printer attached to it. Prior to the upgrade, I was able to print from laptop to the desktop via a local print queue. Now when I try to print, I see in the web interface that the job is listed with "held since <date>". When I click the "Release job" button, the page reloads but the job is still "held since"...

Googling, I see that this "held since" message has existed since 2005:

https://ubuntuforums.org/showthread.php?t=2317549

I'd like some help troubleshooting the problem, which may be related to some recent changes in this software (last month or two?) so that my printer can work again.

However, I also think there is a "discoverability" bug here. I never asked for a job to be "held", I'm getting an error message which not only doesn't point to the source of the problem (a log file? something from the STDERR of some failed command?) but also doesn't even appear to be an error message. It leaves me with no clue how to proceed.

I'm attaching an archive with the files that I think may be relevant: local-cupsd.conf local-error_log local-ppd-B210a_Remote.ppd local-printers.conf remote-cupsd.conf remote-error_log remote-ppd-HP_Photosmart_Plus_B210_series.ppd remote-printers.conf

cups-held-since-bug.zip

It may be of note that after trying many of the options for remote printing (and finding them all broken for me), I finally stumbled upon a piece of documentation suggesting I run something like this:

lpadmin -p B210a_Remote -E -v ipp://nameofmydesktop/printers/HP_Photosmart_Plus_B210_series -m everywhere

That was after I created B210a_Remote via the web interface; it succeeded in making the queue work for me (for a couple of weeks until the recent upgrade).

Thanks in advance.

Raise QPDF version requirement

With the latest cups-filters-1.21.0 I get

filter/pdf.cxx:26:10: fatal error: qpdf/QPDFAcroFormDocumentHelper.hh: No such file or directory
 #include <qpdf/QPDFAcroFormDocumentHelper.hh>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

with having QPDF 8.0.2 installed.

configure.ac states PKG_CHECK_MODULES([LIBQPDF], [libqpdf >= 3.0.2]) as the version requirement for QPDF.

Upgrading to QPDF 8.2.1 allowed cups-filters-1.21.0 to compile.

build fails with poppler-0.71.0

Please reopen #69, the issue is still not fixed.

filter/pdftoraster.cxx: In function 'void outPage(PDFDoc*, Catalog*, int, SplashOutputDev*, cups_raster_t*)':
filter/pdftoraster.cxx:1821:6: error: 'gTrue' was not declared in this scope
gTrue,gTrue,gTrue);
^~~~~
filter/pdftoraster.cxx:1821:6: note: suggested alternative: 'gfree'
gTrue,gTrue,gTrue);
^~~~~
gfree
filter/pdftoraster.cxx: In function 'int main(int, char**)':
filter/pdftoraster.cxx:2131:5: error: 'gFalse' was not declared in this scope
gFalse,paperColor,gTrue
^~~~~~
filter/pdftoraster.cxx:2131:5: note: suggested alternative: 'pause'
gFalse,paperColor,gTrue
^~~~~~
pause
filter/pdftoraster.cxx:2131:23: error: 'gTrue' was not declared in this scope
gFalse,paperColor,gTrue
^~~~~
filter/pdftoraster.cxx:2131:23: note: suggested alternative: 'gfree'
gFalse,paperColor,gTrue
^~~~~
gfree
filter/pdftoraster.cxx:2157:17: warning: 'void ppdClose(ppd_file_t*)' is deprecated: Use cupsCopyDestInfo and friends instead. [-Wdeprecated-declarations]
ppdClose(ppd);
^
In file included from filter/pdftoraster.cxx:49:0:
/usr/include/cups/ppd.h:372:14: note: declared here
extern void ppdClose(ppd_file_t *ppd) _PPD_DEPRECATED;
^~~~~~~~
make[1]: *** [Makefile:4363: pdftoraster-pdftoraster.o] Error 1

print a4 documents sensibly by default on command-line

When I print a PDF whose pages are smaller or larger than letter paper, I find that lp does a poor job of printing it. The printed page appears in the upper-left corner of the paper (medium) page, and the top half of the top line is cut off. Generally I print these documents with Evince and select "Fit to Printable Area" under "Page Handling", that does a better job - it scales up the page and centers it on the physical medium. I wonder if cups-filters can be configured to do the same thing as Evince is doing, it would be nice because I don't always remember to use Evince until after I've printed a document of many pages and found that it came out all wrong.

Here is an example document (one page, pdfinfo says "456 x 687.59 pts"):

sample-8.pdf

cups-browsed and sleep mode

In /etc/cups/cups-browsed.conf option set to
CreateIPPPrinterQueues All
Network printer is autodiscovered and created queue.
When printer goes in sleep mode queue removed.
And i can't send documents to print.
Is there a way to not remove autodiscovered queue? (make it permanent)

build broken with poppler 0.67.0

....
filter/pdf.cxx: In function 'int pdf_fill_form(pdf_t*, opt_t*)':
filter/pdf.cxx:740:44: error: invalid conversion from 'const GooString*' to 'GooString*' [-fpermissive]
field_name = ff->getPartialName();
~~~~~~~~~~~~~~~~~~^~
make[1]: *** [Makefile:3933: bannertopdf-pdf.o] Error 1

wrongs with pdf

We use cups to print PDF, but if PDF contains annotation and form fields, print and print fields will lack these annotations and form

build fails with poppler-0.71.0

x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.       -I/usr/include/libpng16 -I/usr/include/poppler  -I./cupsfilters/ -march=native -mtune=native -O2 -pipe -std=c++11 -Wall  -D_GNU_SOURCE -c -o pdftoraster-pdftoraster.o `test -f 'filter/pdftoraster.cxx' || echo './'`filter/pdftoraster.cxx
filter/pdftoraster.cxx: In function ‘void outPage(PDFDoc*, Catalog*, int, SplashOutputDev*, cups_raster_t*)’:
filter/pdftoraster.cxx:1689:45: error: invalid conversion from ‘const PDFRectangle*’ to ‘PDFRectangle*’ [-fpermissive]
   PDFRectangle *mediaBox = page->getMediaBox();
                            ~~~~~~~~~~~~~~~~~^~
filter/pdftoraster.cxx:1817:6: error: ‘gTrue’ was not declared in this scope
      gTrue,gTrue,gTrue);
      ^~~~~
filter/pdftoraster.cxx:1817:6: note: suggested alternative: ‘gfree’
      gTrue,gTrue,gTrue);
      ^~~~~
      gfree
filter/pdftoraster.cxx: In function ‘int main(int, char**)’:
filter/pdftoraster.cxx:1970:20: error: invalid conversion from ‘void (*)(void*, ErrorCategory, Goffset, char*)’ {aka ‘void (*)(void*, ErrorCategory, long long int, char*)’} to ‘void (*)(void*, ErrorCategory, Goffset, const char*)’ {aka ‘
void (*)(void*, ErrorCategory, long long int, const char*)’} [-fpermissive]
   setErrorCallback(::myErrorFun,NULL);
                    ^~
In file included from /usr/include/poppler/Object.h:45,
                 from filter/pdftoraster.cxx:44:
/usr/include/poppler/Error.h:50:37: note:   initializing argument 1 of ‘void setErrorCallback(void (*)(void*, ErrorCategory, Goffset, const char*), void*)’
 extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
                              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       Goffset pos, const char *msg),
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
filter/pdftoraster.cxx:2127:5: error: ‘gFalse’ was not declared in this scope
     gFalse,paperColor,gTrue
     ^~~~~~
filter/pdftoraster.cxx:2127:5: note: suggested alternative: ‘pause’
     gFalse,paperColor,gTrue
     ^~~~~~
     pause
filter/pdftoraster.cxx:2127:23: error: ‘gTrue’ was not declared in this scope
     gFalse,paperColor,gTrue
                       ^~~~~
filter/pdftoraster.cxx:2127:23: note: suggested alternative: ‘gfree’
     gFalse,paperColor,gTrue
                       ^~~~~
                       gfree
make[1]: *** [Makefile:4366: pdftoraster-pdftoraster.o] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-print/cups-filters-9999/work/cups-filters-9999'
make: *** [Makefile:2076: all] Error 2

At least the gTrue and gFalse issues are caused by the following commit from poppler upstream:
Replace GBool, gTrue, and gFalse by bool, true, false, resp.

Support 'vnd.cups-banner' format to be converted by a 'x-bannertopdf' filter

After having poked a bit into what features the cups-filters bannerfile format application/vnd.cups-pdf-banner and the related bannertopdf filter currently provide, it appears to me that bannertopdf is not able to support the original banner file source format of CUPS itself (i.e. vnd.cups-banner as specified here: https://www.cups.org/doc/spec-banner.html).

While this banner file format is native to CUPS, still the CUPS source code does not provide any filter to convert it to PDF for all platforms -- there is only cgbannertopdf filter for macOS (and cgbannertopdf is not open source).

I do not see any major technical reason why cups-filters should be limiting itself like this, and why there wouldn't be a way to directly support the original application/vnd.cups-banner format.

No printing and "Failed filter" error after upgrading from version 1.20.4 to 1.21.0

Description:

After a full system update (on an Arch Linux system), my Kyocera FS-1000 printer no longer receives any print jobs.

Cups reports the error message "Failed filter".

In the systemd logs I found this:
ANOM_ABEND auid=4294967295 uid=209 gid=209 ses=4294967295 pid=2597 comm="foomatic-rip" exe="/usr/lib/cups/filter/foomatic-rip" sig=11 res=1

The file foomatic-rip belongs to the package cups-filters and that package was indeed updated today (to version 1.21.0-1). After downgrading cups-filters to the previous version (1.20.4-2) the printer is responding normally again.

The issue was confirmed by another user with another printer (Brother HL-2240D).

See my original bug report on the Arch Linux bugtracker.

pdftoraster uses non-public/internal APIs of Poppler

@sahilarora535 investigated the code of pdftoraster and writes:

After going through the code, I found that a lot of poppler APIs are being used in pdftoraster.cxx (please open the link which redirects to the line number). When I built cups-filters for the first time, I distinctively remember I had to install poppler as well since it is a dependency for cups-filters. However, even on installing, files such as “goo/gmem.h” (which are included in the filter) were not found, hence I had to make poppler from the source. Even that did not work. Hence, I had to use a flag which configuring poppler so that these files come along, and the command was |./configure --enable-xpdf-headers| to configure poppler. I guess these are the unstable APIs we have been talking about. My first impression of the code base is that pdftoraster has a lot of uses of poppler’s unstable APIs, and this is what it is. Please correct me if I am wrong.

We need an existing Poppler output device for raster output ot create one if there is no suitable one. Poppler has a pdftoppm utility which generates the genric PPM raster format, so Poppler's output device used by this utility can probably somehow made use of. I do not know the PPM and similar raster graphics formats, for example whether all color spaces available in PWG/CUPS Raster are supported.
Here we have different possibilities depending on what the output formats of pdftoppm are capable of:

  1. A pdftoraster filter which calls pdftoppm on the command line and converts the output into PWG/CUPS Raster.
  2. A pdftoraster filter which uses the Poppler output device which the pdftoppm utility uses, using only public APIs of Poppler and it wraps the output bitmap streams into valid PWG/CUPS Raster.
  3. Either we extend the PPM/raster output device of Poppler to also support PWG/CUPS Raster or we create a new Poppler output device for PWG/CUPS Raster based on Poppler's existing PPM/raster output device. The changes on Poppler we have to submit upstream. Then we do a pdftoraster filter which uses this device.

In any case the new pdftoraster filter should not loose any features, especially support for all color spaces and color management as the current one has.
Note: The same is probably the case for pdftoijs, pdftoopvp, and bannertopdf, but the former two we are deprecating curremtly (they are not installed by default any more) and the latter we will convert to use QPDF (Issue #8).

rastertopclm: Incorrect PCLM output when input raster resolution is not the same as pclm default resolution.

Sometimes it may happen that the default resolution for PCLM is different from what the input raster has. In that case, the PCLM file generated from the rastertopclm filter is incorrect. For instance, if the input raster has a resolution of 600dpi, and the default PCLM resolution in the PPD file is 1200dpi, this is how the resultant PCLM file looks like:

image

when ideally, it should span full page and look like this:

image

The solution to this would be to check what is the resolution of the input raster file, and if that resolution is present in the *cupsPclmSourceResolutionSupported key in the PPD, use that resolution to convert the PCLm file.

const poisoning

Picky compiler complaint (1.20.3 release):

filter/pdftoopvp/OPVPOutputDev.cxx: In member function 'void OPVPOutputDev::doUpdateFont(GfxState*)':
filter/pdftoopvp/OPVPOutputDev.cxx:532:46: error: invalid conversion from 'const Ref*' to 'Ref*' [-fpermissive]
id = new SplashOutFontFileID(gfxFont->getID());
~~~~~~~~~~~~~~^~
filter/pdftoopvp/OPVPOutputDev.cxx:69:3: note: initializing argument 1 of 'SplashOutFontFileID::SplashOutFontFileID(Ref*)'
SplashOutFontFileID(Ref *rA) { r = *rA; substIdx = -1; }
^~~~~~~~~~~~~~~~~~~

cups-browsed segfaults

cups-browsed segfauls shortly after startup:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff64a1666 in strlen () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff64a1666 in strlen () from /lib64/libc.so.6
#1 0x00007ffff64a12ee in strdup () from /lib64/libc.so.6
#2 0x000055555555f84d in new_local_printer (cups_browsed_controlled=0, device_uri=0x0) at utils/cups-browsed.c:764
#3 get_local_printers () at utils/cups-browsed.c:907
#4 update_local_printers () at utils/cups-browsed.c:1156
#5 0x000055555555c8ad in main (argc=1, argv=0x7fffffffdb98) at utils/cups-browsed.c:7949

Looks to me like device-uri is null. I have no local printer and it should add the remote printer from the print server with BrowseRemoteProtocols CUPS.

cups-filters-1.17.9 on Gentoo

can't print because opc-life-over

I reported the problem here: apple/cups#5295 but found out that is is better to report it on this repo. Essentially I want to continue printing despite the warning (warning about opc-life-over). How do I do that?

build broken with poppler 0.69.0

...
CXX pdftoraster-pdftoraster.o
filter/pdftoraster.cxx: In function 'int main(int, char**)':
filter/pdftoraster.cxx:2166:11: error: 'memCheck' is not a member of 'Object'
Object::memCheck(stderr);
^~~~~~~~
filter/pdftoraster.cxx:2167:3: error: 'gMemReport' was not declared in this scope
gMemReport(stderr);
^~~~~~~~~~
filter/pdftoraster.cxx:2167:3: note: suggested alternative: 'rresvport'
gMemReport(stderr);
^~~~~~~~~~
rresvport
make[1]: *** [Makefile:4363: pdftoraster-pdftoraster.o] Error 1

Installing on Centos 6

Hi, I need to install cups-filters for CUPS 2.1.3 (not in any repository for Centos 6) and after ./configure I get this:

gdbus-codegen \
            --interface-prefix org.cups.cupsd \
            --c-namespace Cups \
            --generate-c-code cups-notifier \
            utils/org.cups.cupsd.Notifier.xml
make: gdbus-codegen: Command not found
make: *** [cups-notifier.c] Error 127

Can anyone help me to first, install gdbus-codegen for Centos 6, then cups-filters.

BTW, it is really needed gdbus-codegen?.

JobSheets option is not forwarded to remote printer queues created by cups-browsed

We have set JobSheets option with a value like "mybanner none" to a shared printer queue. File /usr/share/cups/banners/mybanner is available on cups print server and cups print client.

On our cups clients we run cups-browsed to make the shared printers from our cups print server available to all our linux computers. The problem is, that remote print queues created by cups-browsed all have "JobSheets none none" in /etc/cups/printers.conf, but the should have the same value as the remote shared printer have set.

It seems that the option JobSheets value is not forwarded and set to the client printer queue.

We run Fedora 28 with package cups-2.2.8-2.fc29 from koji, rebuild for Fedora 28 by myself, and cups-filters-1.20.4, based on cups-filters-1.20.3-5.fc29 from koji and updated to cups-filters 1.20.4 and rebuild for Fedora 28 by myself.

Where does CUPS Filters expect to find libgs?

A long and winding road has hopefully led me to the right place to resolve this...

As I really don't know what info might be needed, I did a bit of overkill on cut/paste. Mod's do feel free to edit/delete anything here that's not needed or irrelevant. And obviously I'm willing run any diagnostic you need or want.

Ref: https://askubuntu.com/questions/983970/where-does-cups-expect-to-find-libgs
Ref: apple/cups#5320

CUPS is crashing with "Cannot load libgs or libgs version too old then 8.0"

What needs to be symlinked where to fix it?

CUPS 1.7.2
Ubuntu 14.04.5 LTS
Linux anon 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Copy/Paste of crash file (as GitHub says, "we can't process that file"):

troubleshoot-Panasonic-KX-MB2030series.txt

Page 1 (Scheduler not running?):
{'cups_connection_failure': False}
Page 2 (Choose printer):
{'cups_dest': <cups.Dest Panasonic-KX-MB2030series>,
'cups_instance': None,
'cups_queue': u'Panasonic-KX-MB2030series',
'cups_queue_listed': True}
Page 3 (Check printer sanity):
{'cups_device_uri_scheme': u'socket',
'cups_printer_dict': {'device-uri': u'socket://192.168.1.216:9100',
'printer-info': u'Panasonic KX-MB2030series',
'printer-is-shared': False,
'printer-location': u'192.168.1.216',
'printer-make-and-model': u'Panasonic KX-MB2030series',
'printer-state': 3,
'printer-state-message': u'(PID 24605) Cannot load libgs or libgs version too old then 8.0',
'printer-state-reasons': [u'none'],
'printer-type': 10490052,
'printer-uri-supported': u'ipp://localhost:631/printers/Panasonic-KX-MB2030series'},
'cups_printer_remote': False,
'is_cups_class': False,
'local_cups_queue_attributes': {'charset-configured': u'utf-8',
'charset-supported': [u'us-ascii', u'utf-8'],
'color-supported': False,
'compression-supported': [u'none', u'gzip'],
'copies-default': 1,
'copies-supported': (1, 9999),
'cups-version': u'1.7.2',
'device-uri': u'socket://192.168.1.216:9100',
'document-format-default': u'application/octet-stream',
'document-format-supported': [u'application/octet-stream',
u'application/pdf',
u'application/postscript',
u'application/vnd.adobe-reader-postscript',
u'application/vnd.cups-command',
u'application/vnd.cups-pdf',
u'application/vnd.cups-pdf-banner',
u'application/vnd.cups-postscript',
u'application/vnd.cups-raw',
u'application/x-cshell',
u'application/x-csource',
u'application/x-perl',
u'application/x-shell',
u'image/gif',
u'image/jpeg',
u'image/png',
u'image/tiff',
u'image/urf',
u'image/x-bitmap',
u'image/x-photocd',
u'image/x-portable-anymap',
u'image/x-portable-bitmap',
u'image/x-portable-graymap',
u'image/x-portable-pixmap',
u'image/x-sgi-rgb',
u'image/x-sun-raster',
u'image/x-xbitmap',
u'image/x-xpixmap',
u'image/x-xwindowdump',
u'text/css',
u'text/html',
u'text/plain'],
'finishings-default': 3,
'finishings-supported': [3],
'generated-natural-language-supported': [u'en-us'],
'ipp-versions-supported': [u'1.0',
u'1.1',
u'2.0',
u'2.1'],
'ippget-event-life': 15,
'job-creation-attributes-supported': [u'copies',
u'finishings',
u'ipp-attribute-fidelity',
u'job-hold-until',
u'job-name',
u'job-priority',
u'job-sheets',
u'media',
u'media-col',
u'multiple-document-handling',
u'number-up',
u'output-bin',
u'orientation-requested',
u'page-ranges',
u'print-color-mode',
u'print-quality',
u'printer-resolution',
u'sides'],
'job-hold-until-default': u'no-hold',
'job-hold-until-supported': [u'no-hold',
u'indefinite',
u'day-time',
u'evening',
u'night',
u'second-shift',
u'third-shift',
u'weekend'],
'job-ids-supported': True,
'job-k-limit': 0,
'job-k-octets-supported': (0, 476173360),
'job-page-limit': 0,
'job-priority-default': 50,
'job-priority-supported': [100],
'job-quota-period': 0,
'job-settable-attributes-supported': [u'copies',
u'finishings',
u'job-hold-until',
u'job-name',
u'job-priority',
u'media',
u'media-col',
u'multiple-document-handling',
u'number-up',
u'output-bin',
u'orientation-requested',
u'page-ranges',
u'print-color-mode',
u'print-quality',
u'printer-resolution',
u'sides'],
'job-sheets-default': (u'none', u'none'),
'job-sheets-supported': [u'none',
u'classified',
u'confidential',
u'form',
u'secret',
u'standard',
u'topsecret',
u'unclassified'],
'jpeg-k-octets-supported': (0, 476173360),
'jpeg-x-dimension-supported': (0, 65535),
'jpeg-y-dimension-supported': (1, 65535),
'marker-change-time': 1527712187,
'marker-colors': [u'none', u'none'],
'marker-levels': [-1, -1],
'marker-names': [u'Toner', u'Drum'],
'marker-types': [u'toner', u'opc'],
'media-bottom-margin-supported': [423],
'media-col-default': u'(unknown IPP value tag 0x34)',
'media-col-supported': [u'media-bottom-margin',
u'media-left-margin',
u'media-right-margin',
u'media-size',
u'media-source',
u'media-top-margin',
u'media-type'],
'media-default': u'na_letter_8.5x11in',
'media-left-margin-supported': [423],
'media-right-margin-supported': [423],
'media-size-supported': [u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)',
u'(unknown IPP value tag 0x34)'],
'media-source-supported': [u'tray1',
u'manual'],
'media-supported': [u'na_letter_8.5x11in',
u'na_legal_8.5x14in',
u'iso_a4_210x297mm',
u'jis_b5_182x257mm',
u'iso_b5_176x250mm',
u'om_16-k_195.09x269.88mm',
u'oe_85x13in_85x13in',
u'oe_85x134in_85x134in'],
'media-top-margin-supported': [423],
'media-type-supported': [u'stationery',
u'thin-paper',
u'labels'],
'multiple-document-handling-supported': [u'separate-documents-uncollated-copies',
u'separate-documents-collated-copies'],
'multiple-document-jobs-supported': True,
'multiple-operation-time-out': 300,
'natural-language-configured': u'en-us',
'notify-attributes-supported': [u'printer-state-change-time',
u'notify-lease-expiration-time',
u'notify-subscriber-user-name'],
'notify-events-default': [u'job-completed'],
'notify-events-supported': [u'job-completed',
u'job-config-changed',
u'job-created',
u'job-progress',
u'job-state-changed',
u'job-stopped',
u'printer-added',
u'printer-changed',
u'printer-config-changed',
u'printer-deleted',
u'printer-finishings-changed',
u'printer-media-changed',
u'printer-modified',
u'printer-restarted',
u'printer-shutdown',
u'printer-state-changed',
u'printer-stopped',
u'server-audit',
u'server-restarted',
u'server-started',
u'server-stopped'],
'notify-lease-duration-default': 86400,
'notify-lease-duration-supported': (0,
2147483647),
'notify-max-events-supported': [100],
'notify-pull-method-supported': [u'ippget'],
'notify-schemes-supported': [u'dbus',
u'mailto',
u'rss'],
'number-up-default': 1,
'number-up-supported': [1, 2, 4, 6, 9, 16],
'operations-supported': [2,
4,
5,
6,
8,
9,
10,
11,
12,
13,
14,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
34,
35,
37,
38,
56,
57,
59,
16385,
16386,
16387,
16388,
16389,
16390,
16391,
16392,
16393,
16394,
16395,
16396,
16397,
16398,
16399,
16423,
14],
'orientation-requested-default': None,
'orientation-requested-supported': [3,
4,
5,
6],
'output-bin-default': u'face-down',
'output-bin-supported': [u'face-down'],
'page-ranges-supported': True,
'pages-per-minute': 24,
'pdf-k-octets-supported': (0, 476173360),
'pdf-versions-supported': [u'adobe-1.2',
u'adobe-1.3',
u'adobe-1.4',
u'adobe-1.5',
u'adobe-1.6',
u'adobe-1.7',
u'iso-19005-1_2005',
u'iso-32000-1_2008',
u'pwg-5102.3'],
'pdl-override-supported': [u'attempted'],
'port-monitor': u'none',
'port-monitor-supported': [u'none'],
'ppd-timestamp': u'*',
'print-color-mode-default': u'monochrome',
'print-color-mode-supported': [u'monochrome'],
'print-quality-default': 4,
'print-quality-supported': [4],
'printer-commands': [u'AutoConfigure',
u'Clean',
u'PrintSelfTestPage'],
'printer-current-time': u'(IPP_TAG_DATE)',
'printer-dns-sd-name': None,
'printer-error-policy': u'retry-job',
'printer-error-policy-supported': [u'abort-job',
u'retry-current-job',
u'retry-job',
u'stop-printer'],
'printer-icons': u'http://localhost:631/icons/Panasonic-KX-MB2030series.png',
'printer-info': u'Panasonic KX-MB2030series',
'printer-is-accepting-jobs': True,
'printer-is-colormanaged': True,
'printer-is-shared': False,
'printer-location': u'192.168.1.216',
'printer-make-and-model': u'Panasonic KX-MB2030series',
'printer-more-info': u'http://localhost:631/printers/Panasonic-KX-MB2030series',
'printer-name': u'Panasonic-KX-MB2030series',
'printer-op-policy': u'default',
'printer-op-policy-supported': [u'authenticated',
u'default'],
'printer-resolution-default': (300, 300, 3),
'printer-resolution-supported': [(300,
300,
3),
(300,
300,
3)],
'printer-settable-attributes-supported': [u'printer-info',
u'printer-location'],
'printer-state': 3,
'printer-state-change-time': 1527712187,
'printer-state-message': u'(PID 24605) Cannot load libgs or libgs version too old then 8.0',
'printer-state-reasons': [u'none'],
'printer-type': 10490052,
'printer-up-time': 1527712219,
'printer-uri-supported': [u'ipp://localhost:631/printers/Panasonic-KX-MB2030series'],
'printer-uuid': u'urn:uuid:64af5828-f565-3e83-6843-131568919db1',
'queued-job-count': 2,
'server-is-sharing-printers': False,
'sides-default': u'one-sided',
'sides-supported': [u'one-sided'],
'uri-authentication-supported': [u'requesting-user-name'],
'uri-security-supported': [u'none'],
'which-jobs-supported': [u'completed',
u'not-completed',
u'aborted',
u'all',
u'canceled',
u'pending',
u'pending-held',
u'processing',
u'processing-stopped']}}
Page 4 (Check PPD sanity):
{'cups_printer_ppd_defaults': {u'General': {u'InputSlot': u'Tray1',
u'MediaType': u'Plain',
u'PageRegion': u'Letter',
u'PageSize': u'Letter',
u'Poster': u'None'},
u'Output': {u'Collate': u'True'},
u'Quality': {u'Resolution': u'Standard',
u'TonerSave': u'False'}},
'cups_printer_ppd_valid': True,
'missing_pkgs_and_exes': ([], [])}
Page 5 (Local or remote?):
{'printer_is_remote': False}
Page 6 (Printer state reasons):
{'printer-state-message': u'(PID 24605) Cannot load libgs or libgs version too old then 8.0',
'printer-state-reasons': [u'none']}
Page 7 (Error log checkpoint):
{'cups_server_settings': {'BrowseLocalProtocols': 'dnssd',
'DefaultAuthType': 'Basic',
'JobPrivateAccess': 'default',
'JobPrivateValues': 'default',
'MaxLogSize': '0',
'SubscriptionPrivateAccess': 'default',
'SubscriptionPrivateValues': 'default',
'WebInterface': 'Yes',
'_debug_logging': '0',
'_remote_admin': '0',
'_remote_any': '0',
'_share_printers': '0',
'_user_cancel_any': '0'},
'error_log_checkpoint': 28060,
'error_log_debug_logging_set': True}
Page 8 (Error log fetch):
{'error_log': ['D [30/May/2018:15:31:29 -0500] [Client 14] Sending file.',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=28060, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=26012, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=23964, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=21916, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=19868, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=17820, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=15772, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=13724, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=11676, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=9628, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=7580, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=5532, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=3484, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_GET_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=1436, response=(nil)(), pipe_pid=0, file=15',
'D [30/May/2018:15:31:29 -0500] [Client 14] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] POST / HTTP/1.1',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] [Client 14] No authentication data provided.',
'D [30/May/2018:15:31:29 -0500] [Client 14] 2.0 Get-Jobs 99',
'D [30/May/2018:15:31:29 -0500] Get-Jobs ipp://localhost/printers/',
'D [30/May/2018:15:31:29 -0500] [Job 19] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 20] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Client 14] Returning IPP successful-ok for Get-Jobs (ipp://localhost/printers/) from localhost',
'D [30/May/2018:15:31:29 -0500] [Client 14] Content-Length: 291',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=291, response=0x55eb2d8221a0(IPP_IDLE), pipe_pid=0, file=-1',
'D [30/May/2018:15:31:29 -0500] [Client 14] Writing IPP response, ipp_state=DATA, old wused=0, new wused=0',
'D [30/May/2018:15:31:29 -0500] [Client 14] bytes=0, http_state=0, data_remaining=0',
'D [30/May/2018:15:31:29 -0500] [Client 14] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] POST / HTTP/1.1',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] [Client 14] No authentication data provided.',
'D [30/May/2018:15:31:29 -0500] [Client 14] 2.0 Get-Jobs 100',
'D [30/May/2018:15:31:29 -0500] Get-Jobs ipp://localhost/printers/',
'D [30/May/2018:15:31:29 -0500] [Job 1] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 2] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 3] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 4] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 5] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 6] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 7] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 13] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 14] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 15] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 16] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 17] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Job 18] Loading attributes...',
'D [30/May/2018:15:31:29 -0500] [Client 14] Returning IPP successful-ok for Get-Jobs (ipp://localhost/printers/) from localhost',
'D [30/May/2018:15:31:29 -0500] [Client 14] Content-Length: 1259',
'D [30/May/2018:15:31:29 -0500] [Job 1] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 2] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 3] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 4] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 5] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 6] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 7] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 13] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 14] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 15] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 16] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 17] Removing document files.',
'D [30/May/2018:15:31:29 -0500] [Job 18] Removing document files.',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=1259, response=0x55eb2d7e9160(IPP_IDLE), pipe_pid=0, file=-1',
'D [30/May/2018:15:31:29 -0500] [Client 14] Writing IPP response, ipp_state=DATA, old wused=0, new wused=0',
'D [30/May/2018:15:31:29 -0500] [Client 14] bytes=0, http_state=0, data_remaining=0',
'D [30/May/2018:15:31:29 -0500] [Client 14] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 15] Accepted from localhost (Domain)',
'D [30/May/2018:15:31:29 -0500] [Client 15] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 15] PUT /admin/conf/cupsd.conf HTTP/1.1',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] [Client 15] No authentication data provided.',
'D [30/May/2018:15:31:29 -0500] cupsdIsAuthorized: username=""',
'D [30/May/2018:15:31:29 -0500] [Client 15] WWW-Authenticate: Basic realm="CUPS", trc="y"',
'D [30/May/2018:15:31:29 -0500] [Client 15] Closing connection.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 15] Accepted from localhost (Domain)',
'D [30/May/2018:15:31:29 -0500] [Client 15] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 16] Accepted from localhost (Domain)',
'D [30/May/2018:15:31:29 -0500] [Client 16] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] [Client 15] HTTP_STATE_WAITING Closing on EOF',
'D [30/May/2018:15:31:29 -0500] [Client 15] Closing connection.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 15] Accepted from localhost (Domain)',
'D [30/May/2018:15:31:29 -0500] [Client 15] Waiting for request.',
'D [30/May/2018:15:31:29 -0500] [Client 16] HTTP_STATE_WAITING Closing on EOF',
'D [30/May/2018:15:31:29 -0500] [Client 16] Closing connection.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'D [30/May/2018:15:31:29 -0500] [Client 15] PUT /admin/conf/cupsd.conf HTTP/1.1',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] [Client 15] Authorized as root using PeerCred',
'D [30/May/2018:15:31:29 -0500] cupsdIsAuthorized: username="root"',
'D [30/May/2018:15:31:29 -0500] cupsd is not idle any more, canceling shutdown.',
'I [30/May/2018:15:31:29 -0500] Installing config file "/etc/cups/cupsd.conf"...',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"',
'D [30/May/2018:15:31:29 -0500] [Client 14] Closing connection.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Not busy"',
'D [30/May/2018:15:31:29 -0500] [Client 15] Closing connection.',
'D [30/May/2018:15:31:29 -0500] cupsdSetBusyState: newbusy="Not busy", busy="Not busy"',
'E [30/May/2018:15:31:29 -0500] Unknown directive JobPrivateAccess on line 84 of /etc/cups/cupsd.conf.',
'E [30/May/2018:15:31:29 -0500] Unknown directive JobPrivateValues on line 85 of /etc/cups/cupsd.conf.',
'E [30/May/2018:15:31:29 -0500] Unknown directive SubscriptionPrivateAccess on line 86 of /etc/cups/cupsd.conf.',
'E [30/May/2018:15:31:29 -0500] Unknown directive SubscriptionPrivateValues on line 87 of /etc/cups/cupsd.conf.',
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Officejet_6700-Gray..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Officejet_6700-RGB..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Officejet_6700_fax-Gray..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Officejet_6700_fax-RGB..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Panasonic-KX-MB2030series-Gray..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Panasonic-KX-MB2030series-RGB..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'PDF-Gray..' already exists",
"W [30/May/2018:15:31:29 -0500] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'PDF-RGB..' already exists"],
'error_log_debug_logging_unset': True}
Page 9 (Locale issues):
{'printer_page_size': u'Letter',
'system_locale_lang': None,
'user_locale_ctype': 'en_US',
'user_locale_messages': 'en_US'}

can't use page-ranges option on remote printer

I have the following printer configured on my desktop:

<Printer HP_Photosmart_Plus_B210_series>
UUID urn:uuid:f7c17874-8003-30ee-40b0-7f21f5f107c3
Info HP Photosmart Plus B210 series
MakeModel HP Photosmart Plus b210 Series, hpcups 3.18.6
DeviceURI usb://HP/Photosmart%20Plus%20B210%20series?serial=CN0AS2G4JJ05J9&interface=1
State Idle
StateTime 1539324752
ConfigTime 1536921968
Type 8425484
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-current-job
Option outputorder reverse
Attribute marker-colors none,none,none,none
Attribute marker-levels 69,56,57,54
Attribute marker-names black ink,yellow ink,cyan ink,magenta ink
Attribute marker-types ink,ink,ink,ink
Attribute marker-change-time 1506138993
</Printer>

I have it shared to my laptop with the following:

<Printer B210a_Remote>
UUID urn:uuid:424bc4eb-1711-38cd-4889-8957f6b53193
AuthInfoRequired none
Info HP Photosmart Plus B210 series
MakeModel Photosmart Plus b210 Series, hpcups 3.18.6
DeviceURI ipp://amenhotep/printers/HP_Photosmart_Plus_B210_series
State Idle
StateTime 1539324752
ConfigTime 1536905867
Reason cups-waiting-for-job-completed
Reason cups-remote-stopped
Type 4172
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-current-job
Attribute marker-colors none,none,none,none
Attribute marker-levels 69,56,57,54
Attribute marker-names black ink,yellow ink,cyan ink,magenta ink
Attribute marker-types ink,ink,ink,ink
Attribute marker-change-time 1539324752
</Printer>

When I try to print a document using the 'page-ranges' option to select a page, I get an unhelpful "filter failed" error.

client$$ lp -o page-ranges=2 test.pdf
request id is B210a_Remote-1476 (1 file(s))

server$ sudo grep -n "Job 165" /var/log/cups/error_log -C10 > error.txt

Looks like the relevant lines are

48770:D [12/Oct/2018:06:29:41 +0000] [Job 165] PID 26869 (/usr/lib/cups/filter/gstoraster) exited with no errors.
48771:D [12/Oct/2018:06:29:41 +0000] [Job 165] prnt/hpcups/HPCupsFilter.cpp 567: cupsRasterOpen failed, fd = 0
48772:D [12/Oct/2018:06:29:41 +0000] [Job 165] PID 26870 (/usr/lib/cups/filter/hpcups) stopped with status 1.

Here is the full error.txt

Printing multiple copies on Plotter HP Designjet T520

Hello,

I am trying to print multiple copies to a plotter setup in CUPS. Plotter model is HP Designjet T520, since CUPS doesn't have driver for this model i am using an alternative driver HP Designjet T1100 pcl.
I am using library : https://github.com/williamkapke/ipp to send prints, Print request consists of :

  1. data (image)
  2. operation-attributes-tag {
    job-name='any job name'
    document-format = 'image/png' }
  3. Job-attributes-tag {
    copies : 2,
    media : 'om_a-4-transverse_297.04x209.9mm'
    }

This prints only 1 image from plotter.

As per Michael Sweet suggestion I also printed image from CUPS using command prompt :
lp -d UAStore10 -n 3 -o media=A4.Transverse PlotterA4.png

Same result only 1 print.

CUPS Version : 2.1.3
OS : Ubuntu 16.04.4 LTS

Could you please have a look at this one and suggest a solution ?
I already added this issue in CUPS github : apple/cups#5352

Please let me know if I should do some more tests or any info is needed.
Thank you,
Sonia

Documenting format specification of 'application/vnd.cups-pdf-banner' and features of 'bannertopdf'

CUPS on macOS uses a MIME type named application/vnd.cups-banner which is a simple text file format where a few simple keywords define what should be the contents of the banner. Then the filter cgbannertopdf converts that text file and generates a PDF banner page.

The original CUPS MIME type for banner textfiles uses '#CUPS-BANNER' on its first line for recognition.

CUPS provides the exact and complete specification for the format of its banner files here: https://www.cups.org/doc/spec-banner.html

OpenPrinting's cups-filters package does use the MIME type appliation/vnd.cups-pdf-banner and puts #PDF-BANNER into the text file as its first line and runs a filter called bannertopdf to do the conversion.

However, there is no specification of the banner text format used by cups-filters (not even in the README). This gap should be filled.

Also, the bannertopdf filter is completely un-documented.

HP LaserJet Pro P1102 always stuck "sending data to printer"

Hi,
I'm running an up-to-date Arch Linux box with...

kernel 4.18.5
cups 2.2.8
libcups 2.2.8
cups-filters 1.21.1
ghostscript 9.23
poppler 0.67.0

...and latest foo2zjs (2018-05-19) from http://foo2zjs.rkkda.com (not the AUR - but I get the same problem with foo2zjs-nightly from the AUR).
The printer no longer works since about second half of august (2018); I tried downgrading all the above packages (but the kernel) to versions which got installed before, but to no avail.

When I send a job, this is what cups is stuck doing ("ps -AF --forest")...

root       442     1  0 38059 10544   3 05:27 ?        00:00:00 /usr/bin/cupsd -l
cups      1487   442  0 22029 15884   3 05:38 ?        00:00:00  \_ HP_LaserJet_Professional_P1102_su_Gargantua 552 anonymous Test Page 1 job-uuid=urn:uuid:ac02187b-453e-392d-5c5a-054616f19a67 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1535859507 time-at-processing=1535859507
cups      1493  1487  0 14975  6212   0 05:38 ?        00:00:00  |   \_ pdftops 552 anonymous Test Page 1  job-uuid=urn:uuid:ac02187b-453e-392d-5c5a-054616f19a67 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1535859507 time-at-processing=1535859507 /var/spool/cups/tmp/foomatic-kqwNwc
cups      1494  1493  0 51206 27368   0 05:38 ?        00:00:00  |       \_ gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=%stdout -dLanguageLevel=3 -r300 -dCompressFonts=false -dNoT3CCITT -dNOINTERPOLATE -c save pop -f /var/spool/cups/tmp/foomatic-kqwNwc
cups      1495  1493  0 15197  6308   0 05:38 ?        00:00:00  |       \_ pdftops 552 anonymous Test Page 1  job-uuid=urn:uuid:ac02187b-453e-392d-5c5a-054616f19a67 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1535859507 time-at-processing=1535859507
cups      1488   442  0 38166  6372   3 05:38 ?        00:00:00  \_ usb://HP/LaserJet%20Professional%20P1102?serial=000000000Q87FWBPPR1a 552 anonymous Test Page 1 job-uuid=urn:uuid:ac02187b-453e-392d-5c5a-054616f19a67 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1535859507 time-at-processing=1535859507

...until I cancel the job (I waited as long as half an hour, at most). While the job is still active cups web interface says "processing - sending data to the printer" for the job; nothing gets printed, but the green led on the printer blinks as it does when printing (so it seems it's receiving something).

As long as the job is running I have a temp file in "/var/spool/cups/tmp", in the case above it's "foomatic-kqwNwc" (see the "gs" command), which is a complete and well-formed pdf; in order to do some tests, I copied it to "/tmp" before canceling the job; then, on the terminal, piping together the above "gs" command, the "foo2zjs-wrapper" command from "/var/log/cups/error_log" (log level debug, see at the end of post), and the "/usr/lib/cups/backend/usb" command, I managed to print, ie the printer just works flawlessly...

gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=%stdout -dLanguageLevel=3 -r300 -dCompressFonts=false -dNoT3CCITT -dNOINTERPOLATE -c 'save pop' -f /tmp/foomatic-kqwNwc | foo2zjs-wrapper -z2 -P -L0 -r1200x600 -p9 -T3 -m1 -s7 -n1 | DEVICE_URI="usb://HP/LaserJet%20Professional%20P1102?serial=000000000Q87FWBPPR1a"  /usr/lib/cups/backend/usb 552 anonymous Test 1 fakeoption

Note that in order for this to work, the temp file one can copy from "/var/spool/cups/tmp" to "/tmp" must be set readable for the user who will run the command, then any job on the queue must be canceled, and then the printer has to be turned off and then on. Then, the command above works even subsequent times, ie it works every time until another job is queued from some applications to cups. The command works even when cups is not running (obviously).

Here comes the relevant part of "/var/log/cups/error_log"...

D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [02/Sep/2018:06:44:08 +0200] [Client 1] Server address is "/run/cups/cups.sock".
D [02/Sep/2018:06:44:08 +0200] [Client 1] Accepted from localhost (Domain)
D [02/Sep/2018:06:44:08 +0200] [Client 1] Waiting for request.
D [02/Sep/2018:06:44:08 +0200] [Client 1] POST / HTTP/1.1
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Active clients"
D [02/Sep/2018:06:44:08 +0200] [Client 1] Read: status=200, state=6
D [02/Sep/2018:06:44:08 +0200] [Client 1] No authentication data provided.
D [02/Sep/2018:06:44:08 +0200] [Client 1] 2.0 Get-Printer-Attributes 8
D [02/Sep/2018:06:44:08 +0200] Get-Printer-Attributes ipp://localhost:631/printers/HP_LaserJet_Professional_P1102_su_Gargantua
D [02/Sep/2018:06:44:08 +0200] [Client 1] Returning IPP successful-ok for Get-Printer-Attributes (ipp://localhost:631/printers/HP_LaserJet_Professional_P1102_su_Gargantua) from localhost.
D [02/Sep/2018:06:44:08 +0200] [Client 1] Content-Length: 1435
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdSendHeader: code=200, type="application/ipp", auth_type=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] con->http=0x555ab3182c80
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=1435, response=0x555ab316abb0(IPP_STATE_DATA), pipe_pid=0, file=-1
D [02/Sep/2018:06:44:08 +0200] [Client 1] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] bytes=0, http_state=0, data_remaining=1435
D [02/Sep/2018:06:44:08 +0200] [Client 1] Flushing write buffer.
D [02/Sep/2018:06:44:08 +0200] [Client 1] New state is HTTP_STATE_WAITING
D [02/Sep/2018:06:44:08 +0200] [Client 1] Waiting for request.
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [02/Sep/2018:06:44:08 +0200] [Client 1] POST /printers/HP_LaserJet_Professional_P1102_su_Gargantua HTTP/1.1
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [02/Sep/2018:06:44:08 +0200] [Client 1] Read: status=200, state=6
D [02/Sep/2018:06:44:08 +0200] [Client 1] No authentication data provided.
D [02/Sep/2018:06:44:08 +0200] [Client 1] 2.0 Get-Printer-Attributes 9
D [02/Sep/2018:06:44:08 +0200] Get-Printer-Attributes ipp://localhost/printers/HP_LaserJet_Professional_P1102_su_Gargantua
D [02/Sep/2018:06:44:08 +0200] [Client 1] Returning IPP successful-ok for Get-Printer-Attributes (ipp://localhost/printers/HP_LaserJet_Professional_P1102_su_Gargantua) from localhost.
D [02/Sep/2018:06:44:08 +0200] [Client 1] Content-Length: 421992
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdSendHeader: code=200, type="application/ipp", auth_type=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] con->http=0x555ab3182c80
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=421992, response=0x555ab316a2f0(IPP_STATE_DATA), pipe_pid=0, file=-1
D [02/Sep/2018:06:44:08 +0200] [Client 1] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] bytes=0, http_state=0, data_remaining=421992
D [02/Sep/2018:06:44:08 +0200] [Client 1] Flushing write buffer.
D [02/Sep/2018:06:44:08 +0200] [Client 1] New state is HTTP_STATE_WAITING
D [02/Sep/2018:06:44:08 +0200] [Client 1] Waiting for request.
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [02/Sep/2018:06:44:08 +0200] [Client 1] POST /printers/HP_LaserJet_Professional_P1102_su_Gargantua HTTP/1.1
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients", busy="Not busy"
D [02/Sep/2018:06:44:08 +0200] [Client 1] Read: status=200, state=6
D [02/Sep/2018:06:44:08 +0200] [Client 1] No authentication data provided.
D [02/Sep/2018:06:44:08 +0200] [Client 1] 2.0 Create-Job 10
D [02/Sep/2018:06:44:08 +0200] Create-Job ipp://localhost/printers/HP_LaserJet_Professional_P1102_su_Gargantua
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients"
D [02/Sep/2018:06:44:08 +0200] [Job 554] Applying default options...
D [02/Sep/2018:06:44:08 +0200] add_job: requesting-user-name="gnucco"
D [02/Sep/2018:06:44:08 +0200] Adding default job-sheets values "none,none"...
I [02/Sep/2018:06:44:08 +0200] [Job 554] Adding start banner page "none".
D [02/Sep/2018:06:44:08 +0200] Discarding unused job-created event...
I [02/Sep/2018:06:44:08 +0200] [Job 554] Queued on "HP_LaserJet_Professional_P1102_su_Gargantua" by "gnucco".
D [02/Sep/2018:06:44:08 +0200] [Client 1] Returning IPP successful-ok for Create-Job (ipp://localhost/printers/HP_LaserJet_Professional_P1102_su_Gargantua) from localhost.
D [02/Sep/2018:06:44:08 +0200] [Client 1] Content-Length: 201
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdSendHeader: code=200, type="application/ipp", auth_type=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] con->http=0x555ab3182c80
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=201, response=0x555ab31782e0(IPP_STATE_IDLE), pipe_pid=0, file=-1
D [02/Sep/2018:06:44:08 +0200] [Client 1] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] bytes=0, http_state=0, data_remaining=201
D [02/Sep/2018:06:44:08 +0200] [Client 1] Flushing write buffer.
D [02/Sep/2018:06:44:08 +0200] [Client 1] New state is HTTP_STATE_WAITING
D [02/Sep/2018:06:44:08 +0200] [Client 1] Waiting for request.
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Dirty files", busy="Active clients and dirty files"
D [02/Sep/2018:06:44:08 +0200] [Client 1] POST /printers/HP_LaserJet_Professional_P1102_su_Gargantua HTTP/1.1
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Dirty files"
D [02/Sep/2018:06:44:08 +0200] [Client 1] Read: status=200, state=6
D [02/Sep/2018:06:44:08 +0200] [Client 1] No authentication data provided.
D [02/Sep/2018:06:44:08 +0200] [Client 1] 2.0 Send-Document 11
D [02/Sep/2018:06:44:08 +0200] [Client 1] Read: status=100, state=6
D [02/Sep/2018:06:44:08 +0200] [Client 1] Read: status=100, state=6
D [02/Sep/2018:06:44:08 +0200] Send-Document ipp://localhost:631/printers/HP_LaserJet_Professional_P1102_su_Gargantua
D [02/Sep/2018:06:44:08 +0200] cupsdIsAuthorized: requesting-user-name="gnucco"
D [02/Sep/2018:06:44:08 +0200] [Job 554] Auto-typing file...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Request file type is application/pdf.
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
I [02/Sep/2018:06:44:08 +0200] [Job 554] File of type application/pdf queued by "gnucco".
I [02/Sep/2018:06:44:08 +0200] [Job 554] Adding end banner page "none".
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [02/Sep/2018:06:44:08 +0200] [Job 554] time-at-processing=1535863448
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [02/Sep/2018:06:44:08 +0200] Discarding unused printer-state-changed event...
D [02/Sep/2018:06:44:08 +0200] [Job 554] 2 filters for job:
D [02/Sep/2018:06:44:08 +0200] [Job 554] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [02/Sep/2018:06:44:08 +0200] [Job 554] foomatic-rip (application/vnd.cups-pdf to printer/HP_LaserJet_Professional_P1102_su_Gargantua, cost 0)
D [02/Sep/2018:06:44:08 +0200] [Job 554] job-sheets=none,none
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[0]="HP_LaserJet_Professional_P1102_su_Gargantua"
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[1]="554"
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[2]="gnucco"
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[3]="provastampa.odt"
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[4]="1"
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[5]="InputSlot=Auto PageSize=Letter job-uuid=urn:uuid:d6e5565b-6600-3187-7334-81a19301f117 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1535863448 time-at-processing=1535863448 document-name-supplied=DhRNfu"
D [02/Sep/2018:06:44:08 +0200] [Job 554] argv[6]="/var/spool/cups/d00554-001"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[7]="CUPS_STATEDIR=/run/cups"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[8]="HOME=/var/spool/cups/tmp"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/bin:/bin:/usr/bin"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[10]="[email protected]"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[11]="SOFTWARE=CUPS/2.2.8"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[13]="USER=root"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[14]="CUPS_MAX_MESSAGE=2047"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[15]="CUPS_SERVER=/run/cups/cups.sock"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[16]="CUPS_ENCRYPTION=IfRequested"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[17]="IPP_PORT=631"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[18]="CHARSET=utf-8"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[19]="LANG=it_IT.UTF-8"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[20]="PPD=/etc/cups/ppd/HP_LaserJet_Professional_P1102_su_Gargantua.ppd"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[21]="RIP_MAX_CACHE=128m"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[22]="CONTENT_TYPE=application/pdf"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[23]="DEVICE_URI=usb://HP/LaserJet%20Professional%20P1102?serial=000000000Q87FWBPPR1a"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[24]="PRINTER_INFO=HP LaserJet Professional P1102"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[25]="PRINTER_LOCATION=Gargantua"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[26]="PRINTER=HP_LaserJet_Professional_P1102_su_Gargantua"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[27]="PRINTER_STATE_REASONS=none"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[28]="CUPS_FILETYPE=document"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[29]="FINAL_CONTENT_TYPE=application/vnd.cups-pdf"
D [02/Sep/2018:06:44:08 +0200] [Job 554] envp[30]="AUTH_I****"
I [02/Sep/2018:06:44:08 +0200] [Job 554] Started filter /usr/lib/cups/filter/pdftopdf (PID 2253)
I [02/Sep/2018:06:44:08 +0200] [Job 554] Started filter /usr/lib/cups/filter/foomatic-rip (PID 2254)
I [02/Sep/2018:06:44:08 +0200] [Job 554] Started backend /usr/lib/cups/backend/usb (PID 2255)
D [02/Sep/2018:06:44:08 +0200] Discarding unused job-state-changed event...
D [02/Sep/2018:06:44:08 +0200] [Client 1] Returning IPP successful-ok for Send-Document (ipp://localhost:631/printers/HP_LaserJet_Professional_P1102_su_Gargantua) from localhost.
D [02/Sep/2018:06:44:08 +0200] [Client 1] Content-Length: 171
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdSendHeader: code=200, type="application/ipp", auth_type=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] con->http=0x555ab3182c80
D [02/Sep/2018:06:44:08 +0200] [Client 1] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=171, response=0x555ab316abb0(IPP_STATE_DATA), pipe_pid=0, file=-1
D [02/Sep/2018:06:44:08 +0200] [Client 1] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
D [02/Sep/2018:06:44:08 +0200] [Client 1] bytes=0, http_state=0, data_remaining=171
D [02/Sep/2018:06:44:08 +0200] [Client 1] Flushing write buffer.
D [02/Sep/2018:06:44:08 +0200] [Client 1] New state is HTTP_STATE_WAITING
D [02/Sep/2018:06:44:08 +0200] [Client 1] Waiting for request.
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Active clients and dirty files"
D [02/Sep/2018:06:44:08 +0200] [Job 554] pdftopdf: Last filter determined by the PPD: foomatic-rip; FINAL_CONTENT_TYPE: application/vnd.cups-pdf => pdftopdf will log pages in page_log.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Calling FindDeviceById(cups-HP_LaserJet_Professional_P1102_su_Gargantua)
D [02/Sep/2018:06:44:08 +0200] [Job 554] PAGE: 1 1
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [02/Sep/2018:06:44:08 +0200] Discarding unused job-progress event...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Found device /org/freedesktop/ColorManager/devices/cups_HP_LaserJet_Professional_P1102_su_Gargantua
D [02/Sep/2018:06:44:08 +0200] [Job 554] Calling org.freedesktop.ColorManager.Device.Get(ProfilingInhibitors)
D [02/Sep/2018:06:44:08 +0200] [Job 554] \'CM Color Calibration\' Mode in SPOOLER-LESS: Off
D [02/Sep/2018:06:44:08 +0200] [Job 554] Getting input from file
D [02/Sep/2018:06:44:08 +0200] [Job 554] foomatic-rip version 1.21.1 running...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Parsing PPD file ...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option ColorSpace
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option PageSize
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option Quality
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option Resolution
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option ImageableArea
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option PaperDimension
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option InputSlot
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option MediaType
D [02/Sep/2018:06:44:08 +0200] [Job 554] PID 2253 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option Density
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option Copies
D [02/Sep/2018:06:44:08 +0200] [Job 554] Loading USB quirks from \"/usr/share/cups/usb\".
D [02/Sep/2018:06:44:08 +0200] [Job 554] Loaded 89 quirks.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Printing on printer with URI: usb://HP/LaserJet%20Professional%20P1102?serial=000000000Q87FWBPPR1a
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option halftone
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option NupOrient
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option NupPages
D [02/Sep/2018:06:44:08 +0200] [Job 554] Added option Font
D [02/Sep/2018:06:44:08 +0200] [Job 554] Parameter Summary
D [02/Sep/2018:06:44:08 +0200] [Job 554] -----------------
D [02/Sep/2018:06:44:08 +0200] [Job 554] Spooler: cups
D [02/Sep/2018:06:44:08 +0200] [Job 554] Printer: HP_LaserJet_Professional_P1102_su_Gargantua
D [02/Sep/2018:06:44:08 +0200] [Job 554] Shell: /bin/bash
D [02/Sep/2018:06:44:08 +0200] [Job 554] PPD file: /etc/cups/ppd/HP_LaserJet_Professional_P1102_su_Gargantua.ppd
D [02/Sep/2018:06:44:08 +0200] [Job 554] ATTR file:
D [02/Sep/2018:06:44:08 +0200] [Job 554] Printer model: HP LaserJet Pro P1102 Foomatic/foo2zjs-z2 (recommended)
D [02/Sep/2018:06:44:08 +0200] [Job 554] Job title: provastampa.odt
D [02/Sep/2018:06:44:08 +0200] [Job 554] File(s) to be printed:
D [02/Sep/2018:06:44:08 +0200] [Job 554] <STDIN>
D [02/Sep/2018:06:44:08 +0200] [Job 554] Ghostscript extra search path (\'GS_LIB\'): /usr/share/cups/fonts
D [02/Sep/2018:06:44:08 +0200] [Job 554] Printing system options:
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'job-uuid=urn:uuid:d6e5565b-6600-3187-7334-81a19301f117\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option job-uuid=urn:uuid:d6e5565b-6600-3187-7334-81a19301f117.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'job-originating-host-name=localhost\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option job-originating-host-name=localhost.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'date-time-at-creation=\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option date-time-at-creation=.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'date-time-at-processing=\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option date-time-at-processing=.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'time-at-creation=1535863448\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option time-at-creation=1535863448.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'time-at-processing=1535863448\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option time-at-processing=1535863448.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'document-name-supplied=DhRNfu\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Unknown option document-name-supplied=DhRNfu.
D [02/Sep/2018:06:44:08 +0200] [Job 554] CM Color Calibration Mode in CUPS: Off
D [02/Sep/2018:06:44:08 +0200] [Job 554] Options from the PPD file:
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'InputSlot=Auto\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] Pondering option \'PageSize=Letter\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] ================================================
D [02/Sep/2018:06:44:08 +0200] [Job 554] File: <STDIN>
D [02/Sep/2018:06:44:08 +0200] [Job 554] ================================================
D [02/Sep/2018:06:44:08 +0200] [Job 554] Filetype: PDF
D [02/Sep/2018:06:44:08 +0200] [Job 554] Neither PDF renderer command line nor Ghostscript-based renderer command line found
D [02/Sep/2018:06:44:08 +0200] [Job 554] Driver does not understand PDF input, converting to PostScript
D [02/Sep/2018:06:44:08 +0200] [Job 554] Storing temporary files in /var/spool/cups/tmp
D [02/Sep/2018:06:44:08 +0200] [Job 554] libusb_get_device_list=6
D [02/Sep/2018:06:44:08 +0200] [Job 554] Starting process \"pdf-to-ps\" (generation 1)
D [02/Sep/2018:06:44:08 +0200] [Job 554] STATE: +connecting-to-device
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Dirty files", busy="Printing jobs and dirty files"
D [02/Sep/2018:06:44:08 +0200] Discarding unused printer-state-changed event...
D [02/Sep/2018:06:44:08 +0200] [Job 554] STATE: -connecting-to-device
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Dirty files"
D [02/Sep/2018:06:44:08 +0200] Discarding unused printer-state-changed event...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Device protocol: 2
D [02/Sep/2018:06:44:08 +0200] [Job 554] Printer does not like usblp kernel module to be re-attached after job
D [02/Sep/2018:06:44:08 +0200] [Job 554] Invio dei dati alla stampante.
D [02/Sep/2018:06:44:08 +0200] cupsdMarkDirty(---J-)
D [02/Sep/2018:06:44:08 +0200] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Printing jobs and dirty files"
D [02/Sep/2018:06:44:08 +0200] [Job 554] Set job-printer-state-message to "Invio dei dati alla stampante.", current level=INFO
D [02/Sep/2018:06:44:08 +0200] Discarding unused job-progress event...
D [02/Sep/2018:06:44:08 +0200] Discarding unused printer-state-changed event...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Printer make and model: HP HP LaserJet Professional P1102
D [02/Sep/2018:06:44:08 +0200] [Job 554] Running command line for pstops: pstops 554 gnucco provastampa.odt 1 \' InputSlot=Auto PageSize=Letter job-uuid=urn:uuid:d6e5565b-6600-3187-7334-81a19301f117 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1535863448 time-at-processing=1535863448 document-name-supplied=DhRNfu\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] No resolution information found in the PPD file.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Using image rendering resolution 300 dpi
D [02/Sep/2018:06:44:08 +0200] [Job 554] Running command line for gs: gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=%stdout -dLanguageLevel=3 -r300 -dCompressFonts=false -dNoT3CCITT -dNOINTERPOLATE -c \'save pop\' -f /var/spool/cups/tmp/foomatic-kqwNwc
D [02/Sep/2018:06:44:08 +0200] [Job 554] Started filter gs (PID 2261)
D [02/Sep/2018:06:44:08 +0200] [Job 554] Started filter pstops (PID 2262)
D [02/Sep/2018:06:44:08 +0200] [Job 554] Page = 612x792; 11,11 to 601,781
D [02/Sep/2018:06:44:08 +0200] [Job 554] slow_collate=0, slow_duplex=0, slow_order=0
D [02/Sep/2018:06:44:08 +0200] [Job 554] Before copy_comments - %!PS-Adobe-3.0
D [02/Sep/2018:06:44:08 +0200] [Job 554] %!PS-Adobe-3.0
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%BoundingBox: 0 0 612 792
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%HiResBoundingBox: 0 0 612.00 792.00
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%Creator: GPL Ghostscript 923 (ps2write)
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%LanguageLevel: 2
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%CreationDate: D:20180902064408+02\'00\'
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%Pages: 1
D [02/Sep/2018:06:44:08 +0200] [Job 554] %%EndComments
D [02/Sep/2018:06:44:08 +0200] [Job 554] Before copy_prolog - %%BeginProlog
D [02/Sep/2018:06:44:08 +0200] [Job 554] Filetype: PostScript
D [02/Sep/2018:06:44:08 +0200] [Job 554] Reading PostScript input ...
D [02/Sep/2018:06:44:08 +0200] [Job 554] --> This document is DSC-conforming!
D [02/Sep/2018:06:44:08 +0200] [Job 554] Found %RBINumCopies: 1
D [02/Sep/2018:06:44:08 +0200] [Job 554] -----------
D [02/Sep/2018:06:44:08 +0200] [Job 554] Found: %%BeginProlog
D [02/Sep/2018:06:44:08 +0200] [Job 554] Inserting option code into \"Prolog\" section.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Flushing FIFO.
D [02/Sep/2018:06:44:08 +0200] [Job 554] \"Prolog\" section is missing, inserting it.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Inserting option code into \"Prolog\" section.
D [02/Sep/2018:06:44:08 +0200] [Job 554] Starting renderer with command: \"foo2zjs-wrapper -z2 -P -L0     -r1200x600 -p1 -T3 -m1 -s7   -n1 \"
D [02/Sep/2018:06:44:08 +0200] [Job 554] Starting process \"kid3\" (generation 1)
D [02/Sep/2018:06:44:08 +0200] [Job 554] Closing renderer
D [02/Sep/2018:06:44:08 +0200] [Job 554] Starting process \"kid4\" (generation 2)
D [02/Sep/2018:06:44:08 +0200] [Job 554] Starting process \"renderer\" (generation 2)
D [02/Sep/2018:06:44:08 +0200] [Job 554] JCL: \033%-12345X@PJL
D [02/Sep/2018:06:44:08 +0200] [Job 554] <job data>
D [02/Sep/2018:06:44:08 +0200] [Job 554] Not a pbm file!
D [02/Sep/2018:06:44:08 +0200] [Job 554] renderer exited with status 0
D [02/Sep/2018:06:44:08 +0200] [Job 554] Read 312 bytes of print data...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Wrote 312 bytes of print data...
D [02/Sep/2018:06:44:08 +0200] [Job 554] kid4 exited with status 0
D [02/Sep/2018:06:44:08 +0200] [Job 554] kid3 finished
D [02/Sep/2018:06:44:08 +0200] [Job 554] kid3 exited with status 0
D [02/Sep/2018:06:44:08 +0200] [Job 554] Read 56 bytes of back-channel data...
D [02/Sep/2018:06:44:08 +0200] [Job 554] Read 59 bytes of back-channel data...
D [02/Sep/2018:06:44:38 +0200] [Job 554] Read 58 bytes of back-channel data...
I [02/Sep/2018:06:44:38 +0200] Saving job.cache...
D [02/Sep/2018:06:44:38 +0200] cupsdSetBusyState: newbusy="Printing jobs", busy="Printing jobs and dirty files"
D [02/Sep/2018:06:44:38 +0200] Report: clients=1
D [02/Sep/2018:06:44:38 +0200] Report: jobs=16
D [02/Sep/2018:06:44:38 +0200] Report: jobs-active=1
D [02/Sep/2018:06:44:38 +0200] Report: printers=1
D [02/Sep/2018:06:44:38 +0200] Report: stringpool-string-count=17621
D [02/Sep/2018:06:44:38 +0200] Report: stringpool-alloc-bytes=11496
D [02/Sep/2018:06:44:38 +0200] Report: stringpool-total-bytes=319600
D [02/Sep/2018:06:45:08 +0200] [Job 554] Read 58 bytes of back-channel data...

RFE: make debug mode configurable from cups-browsed.conf

Hi Till,

I think it would be good to have a way to set cups-browsed debug log in cups-browsed.conf, like cupsd has with 'LogLevel'. (IMO we can use something like DebugLog on/off)
I can look into it and create a patch, if you have other matters to attend to.

Further build issues with Poppler 0.71

After applying 48625da I am still getting build issues with poppler 0.71

  CXX      pdftoopvp-OPVPSplashClip.o
filter/pdftoopvp/oprs/OPVPSplashClip.cxx: In member function ‘OPVPSplashPath* OPVPSplashClip::makePath()’:
filter/pdftoopvp/oprs/OPVPSplashClip.cxx:43:16: error: ‘class SplashXPathScanner’ has no member named ‘getNextSpan’; did you mean ‘testSpan’?
   scanners[0]->getNextSpan(tsyMin-2,&x0,&x1);
                ^~~~~~~~~~~
                testSpan
filter/pdftoopvp/oprs/OPVPSplashClip.cxx:50:25: error: ‘class SplashXPathScanner’ has no member named ‘getNextSpan’; did you mean ‘testSpan’?
     while (scanners[0]->getNextSpan(y,&x0,&x1)) {
                         ^~~~~~~~~~~
                         testSpan
filter/pdftoopvp/oprs/OPVPSplashClip.cxx:62:27: error: ‘class SplashXPathScanner’ has no member named ‘getNextSpan’; did you mean ‘testSpan’?
       while (scanners[j]->getNextSpan(y,&x0,&x1)) {
                           ^~~~~~~~~~~
                           testSpan
make[1]: *** [Makefile:4082: pdftoopvp-OPVPSplashClip.o] Error 1

After a small search I found a related change in poppler:-

https://cgit.freedesktop.org/poppler/poppler/commit/?id=68fdbfd0b159e8cf146c480f0d14f5d7adfd5806

Which seems to be causing the error. Modifying to match the new upstream behaviour should hopefully resolve the error.

This slightly broken PDF file doesn't print with fitplot, prints without it

QPDF project recently released version 7.0.0, fixing the issue qpdf/qpdf#106
I compiled fresh cups-filters with qpdf 7.0.0 and it can print many more files now.

However, here is a curious problem with this file: shineline.pdf

It prints ok if sent to print untouched: "lp shineline.pdf". At the same time, it doesn't print and produces blank pages if printed as lp -o fit-to-page shineline.pdf.

Looks like pdftopdf is performing some scaling on it, and that scaling breaks the file.

Unscaled file has this many errors in error_log:

/var/spool/cups/d00035-001 (file position 56627): error decoding stream data for object 29 0: stream inflate: inflate: data: incorrect data check
/var/spool/cups/d00035-001 (file position 56627): stream will be re-processed without filtering to avoid data loss
Set job-printer-state-message to "/var/spool/cups/d00035-001 (file position 56627): stream will be re-processed without filtering to avoid data loss", current level=WARN
/var/spool/cups/d00035-001 (file position 64303): error decoding stream data for object 30 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00035-001 (file position 64303): error decoding stream data for object 30 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00035-001 (file position 64303): stream will be re-processed without filtering to avoid data loss
Set job-printer-state-message to "/var/spool/cups/d00035-001 (file position 64303): stream will be re-processed without filtering to avoid data loss", current level=WARN
/var/spool/cups/d00035-001 (file position 67427): error decoding stream data for object 31 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00035-001 (file position 67427): error decoding stream data for object 31 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00035-001 (file position 67427): stream will be re-processed without filtering to avoid data loss
Set job-printer-state-message to "/var/spool/cups/d00035-001 (file position 67427): stream will be re-processed without filtering to avoid data loss", current level=WARN
PID 21403 (/usr/lib/cups/filter/pdftopdf) exited with no errors.

Scaled file has twice more, and they start much earlier than 56627:

/var/spool/cups/d00036-001 (file position 238): error decoding stream data for object 4 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 238): error decoding stream data for object 4 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 2855): error decoding stream data for object 8 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 2855): error decoding stream data for object 8 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 7006): error decoding stream data for object 10 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 7006): error decoding stream data for object 10 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 10485): error decoding stream data for object 12 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 10485): error decoding stream data for object 12 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 14385): error decoding stream data for object 14 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 14385): error decoding stream data for object 14 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 18729): error decoding stream data for object 16 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 18729): error decoding stream data for object 16 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 56627): error decoding stream data for object 29 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 56627): error decoding stream data for object 29 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 56627): stream will be re-processed without filtering to avoid data loss
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 56627): stream will be re-processed without filtering to avoid data loss", current level=WARN
/var/spool/cups/d00036-001 (file position 64303): error decoding stream data for object 30 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 64303): error decoding stream data for object 30 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 64303): stream will be re-processed without filtering to avoid data loss
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 64303): stream will be re-processed without filtering to avoid data loss", current level=WARN
/var/spool/cups/d00036-001 (file position 67427): error decoding stream data for object 31 0: stream inflate: inflate: data: incorrect data check
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 67427): error decoding stream data for object 31 0: stream inflate: inflate: data: incorrect data check", current level=WARN
/var/spool/cups/d00036-001 (file position 67427): stream will be re-processed without filtering to avoid data loss
Set job-printer-state-message to "/var/spool/cups/d00036-001 (file position 67427): stream will be re-processed without filtering to avoid data loss", current level=WARN
PID 21827 (/usr/lib/cups/filter/pdftopdf) exited with no errors.

Is this fixable, what do you think?

cups-browsed SEGFAULTs when cupsEnumDests() returned dest has no "device-uri" option

cups-browsed 1.20.0 crashes when starting up on Gentoo Linux.
I have a CUPS print server in my LAN that advertises printers through DNS-SD.

# cups-browsed --debug
Fri Feb  2 18:20:40 2018 Reading command line option --debug, turning on debug mode (Log on standard error).
Fri Feb  2 18:20:40 2018 cups-browsed of cups-filters version 1.20.0 starting.
Fri Feb  2 18:20:40 2018 Reading config: BrowseRemoteProtocols dnssd
Fri Feb  2 18:20:40 2018 Reading config: CreateIPPPrinterQueues All
Fri Feb  2 18:20:40 2018 No "Browse..." line at all, accept all servers ("BrowseOrder Deny,Allow").
Fri Feb  2 18:20:40 2018 main() in THREAD -1225566704
Fri Feb  2 18:20:40 2018 cups-browsed: Creating http connection to local CUPS daemon: /run/cups/cups.sock:631
Fri Feb  2 18:20:40 2018 update_netifs() in THREAD -1225566704
Fri Feb  2 18:20:40 2018 network interface at 192.168.0.38
Fri Feb  2 18:20:40 2018 cups-browsed [BrowsePoll /run/cups/cups.sock:0]: IPP-Create-Subscription
Fri Feb  2 18:20:40 2018 cups-browsed [BrowsePoll /run/cups/cups.sock:0]: subscription ID=58
Fri Feb  2 18:20:41 2018 cups-browsed (/run/cups/cups.sock): cupsEnumDests
Segmentation fault

I could debug it so far that in cups-browsed.c in get_local_printers(void) when iterating through dests, the device_uri is NULL (for some printers?).
For example:

{
  name = 0x7d714 "HP Deskjet 6940 @ Print-Server", 
  instance = 0x0, 
  is_default = 0, 
  num_options = 5, 
  options = 0x7fbe8 {
    {name = 0x7e2fc "printer-info", value = 0x7d714 "HP Deskjet 6940 @ Print-Server"}, 
    {name = 0x7bccc "printer-location", value = 0x7d904 "Keller"}, 
    {name = 0x7bd1c "printer-make-and-model", value = 0x7014c "HP Deskjet 6943 Printer"}, 
    {name = 0x7d144 "printer-type", value = 0x7d0fc "36894"}, 
    {name = 0x70a4c "printer-uri-supported", value = 0x7e314 "ipps://HP%20Deskjet%206940%20%40%20Print-Server._ipps._tcp.local/cups"}
  }
}

As a result the application segfaults in new_local_printer(device_uri, cups_browsed_controlled) on line 765, because device_uri is NULL

  printer->device_uri = strdup (device_uri);

bannertopdf should not depend on Poppler

bannertopdf generates PDF files for banner pages and test pages. It does not render existing PDF files, so it does not need a PDF interpreter, so Poppler is not really needed for this task. QPDF would be good enough here. QPDF is a helper to generate and modify PDFs, especially to create a correct XREF table.
Also we want to give the user the liberty to use cups-filters with one single PDF interpreter, one of Ghostscript, Poppler, and MuPDF, so that on devices with low resources (mobile, IoT, ...) one does not need the redundancy of more than one PDF interpreter.
Currently one looses banner and test page functionality if one does not have Poppler installed, so actually only Poppler works as a single PDF interpreter for cups-filters.
It is also possible that bannertopdf uses non-public (internal) APIs of Poppler which can make it easily break with updates of Poppler, but I am not sure whether this is really the case.
Therefore we need to convert bannertopdf to use QPDF instead of Poppler.
Hint: All Poppler use is in filter/pdf.cxx.

remote cups queues are no longer discovered

Hi Till,
I was testing cups-filters-1.20.2, but my company printers - remote cups queues from cups server - are no longer discovered. I saw the commit d6323a8 , which changes remote cups queues discovering to recognizing printer->type from avahi only.
I think it is caused by this patch:
+#else
/* Check by the resource whether the discovered printer is a CUPS queue /
if (!strncasecmp(resource, "printers/", 9) ||
!strncasecmp(resource, "classes/", 8))
/
This is a remote CUPS queue or class / │
is_cups_queue = 1;
+#endif /
HAVE_AVAHI */
when this part of code is used only when avahi is not used, remote cups queues aren't discovered.
It seems some printers don't advertise its printer type through mdns. Error message of cups-browsed:

Wed Apr 4 10:07:26 2018 Cannot create remote printer Canon_imageRUNNER_ADVANCE_C3530i_MFP_example_com (URI: ipp://example.com:631/printers/brno3-tpb-0th-it, Model: (null), Accepted data formats: (null)) as its PDLs are not known, ignoring this printer.

Help: I Want to Change Halftone Setting in Printer Driver (CUPS)

I am using CUPS with the printer driver which use "application/vnd.cups-raster 10 rastertopj" and i am trying to get the look of Windows PC halftoning: dither 4x4 print/output but i am clueless where to change the setting for choosing different halftoning pattern..

i also contacted the Ghostscript support and they said halftoning is done by the driver and also told that If the driver is Ghostscript-based you may be able to change the halftone as you’d like, and yes this is indeed Ghostscript-based printer (Cups)driver cause when i open the .PPD file i see *Product: "(ESP Ghostscript)".

here is the printer driver/source: http://www.jfbdtp.com/Pentax/pj-linux-cups.tar.gz

this is the halftone output its printing: https://imgur.com/a/18hkC1H or https://imgur.com/download/7pTksX4

this is the output i am looking for: https://imgur.com/a/KZTQrkp or https://imgur.com/download/5FnpKEM

here is the side by side comparison: https://imgur.com/a/N1rZYSS on the left its what i am getting which i think call 'elliptical spot shape' and on the right side its what i am getting from Windows 7 PC from i select a generic driver with Halftoning selection: Dither 4x4.

Can you please guide me on how or where to change the halftoning of the printer filter/driver?
Thankyou

cups-browsed created and deletes remote cups queues repeatedly

cups-browsed seams to create remote cups queues, and then it deletes the created queues. This occures repeatedly and consumes cpu time of cups process.

I don't know why the queues are deleted. I'm not sure, but I think it occurs first in some cups-filters 1.21.* versions.

There is also a strange error message, I haven't found the cause of it, and I don't know if it is related to this problem, because I found this message since a long time.

I have Fedora 29 with cups-2.2.10 and cups-filters-1.21.5, build rpm packages myself from source, based on the latest Fedora packages from koji (but with newer source from github).

cups-browsed-crashed.txt

Header and Footer are not getting printer during conversion of a banner file using bannertopdf.

The Header and Footer keywords in a banner file are not getting printed when converted using bannertopdf filter. Here are the contents of the banner file:

#PDF-BANNER
Template default.pdf
Header Hello
Footer World
Show job-id

The file default.pdf can be found here.

The resulting PDF file do have job-id, or other information which is specified in the Show keyword, but no header or footer.

Here is the log for the conversion:

DEBUG: argv[0]="cupsfilter"
DEBUG: argv[1]="1"
DEBUG: argv[2]="sahil"
DEBUG: argv[3]="default"
DEBUG: argv[4]="1"
DEBUG: argv[5]=""
DEBUG: argv[6]="default"
DEBUG: envp[0]="<CFProcessPath>"
DEBUG: envp[1]="CONTENT_TYPE=application/vnd.cups-pdf-banner"
DEBUG: envp[2]="CUPS_DATADIR=/usr/share/cups"
DEBUG: envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
DEBUG: envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
DEBUG: envp[5]="CUPS_SERVERROOT=/etc/cups"
DEBUG: envp[6]="LANG=en_US.UTF8"
DEBUG: envp[7]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
DEBUG: envp[8]="PPD=/usr/share/cups/model/laserjet.ppd"
DEBUG: envp[9]="PRINTER_INFO=cupsfilter"
DEBUG: envp[10]="PRINTER_LOCATION=Unknown"
DEBUG: envp[11]="PRINTER=cupsfilter"
DEBUG: envp[12]="RIP_MAX_CACHE=128m"
DEBUG: envp[13]="USER=sahil"
DEBUG: envp[14]="CHARSET=utf-8"
DEBUG: envp[15]="FINAL_CONTENT_TYPE=application/pdf"
INFO: bannertopdf (PID 22483) started.
DEBUG: Could not open PPD file '/usr/share/cups/model/laserjet.ppd'
PDF template file doesn't have form. It's okay.
INFO: bannertopdf (PID 22483) exited with no errors.

cups-browsed should reload-or-restart after network changes

I have BrowsePoll lines for the main network environments where I use my laptop. But when changing to such a network (replugging, suspend/resume) I cannot use those printers: They are detected by cups:

woodstock:~% lpstat -a
ml2850 accepting requests since Sun 11 Mar 2018 08:24:14 CET

but when trying to print there is an error message:

E [11/Mar/2018:08:24:14 +0100] [Client 7] Returning IPP client-error-bad-request for CUPS-Add-Modify-Printer (ipp://localhost:631/printers/ml2850) from localhost
E [11/Mar/2018:08:33:43 +0100] [Job 100] No destination host name supplied by cups-browsed for printer \"ml2850\", is cups-browsed running?

I have to restart cups-browsed to be able to print to this printer. As this will also delete already submitted print jobs, such a restart should happen automatically after network changes (and/or resumes?)

(See also bugreport https://bugzilla.opensuse.org/show_bug.cgi?id=1084799)

problems with specifying output order

I submitted this issue to CUPS last week. At the time it seemed obvious to me that it was a CUPS issue, but Michael Sweet argues that it is a cups-filters issue and I wanted to make your project aware of it. I want to pass this off to someone else if I can.

apple/cups#5315

The gist of it is that I have an inkjet printer and I found it confusing that the pages come out in the wrong order. Not only does the default PPD not correctly reverse the pages, but the various ways of setting the output order (via the PPD, via lpadmin and via lpoptions) all seem to have different effects on documents printed by different applications. If you want to, you can play with this just using cups-pdf. If I modify the cups-pdf PPD with a 'DefaultOutputOrder: "reverse"' line, then according to my experiments this directive is honored by lp and Evince but not Okular. The lpoptions settings are honored by lp but not Evince or xpdf.

I am aware of one mistake in my original bug report, in a follow-up post I commented that 'lp' doesn't respect the 'lpadmin' setting but it does. This misunderstanding was due to my not figuring out the need to delete the 'lpoptions' setting with 'lpoptions -r', before repeating my experiments with lpadmin.

In case it helps, here are some issues I've identified while reading the documentation and trying to understand the behavior of CUPS.

  • Relationship between lpadmin and lpoptions is not explained in respective manual pages

  • User has no way to know that a GUI application like Evince or xpdf will ignore lpoptions but honor lpadmin settings. Should be fixed or documented.

  • Okular fails to respect the "reverse" setting in the PPD. You have to manually check the "reverse" button each time. But xpdf, which has the same print dialog and also seems based on qt5, lacks this problem. I couldn't find any documentation of the correct behavior.

  • User has no way to know the proper place to set a 'reverse' output order for a face-up printer. The fact that this belongs in the PPD should be documented somewhere other than message boards and mailing lists.

  • Output order should be configurable at printer setup time, via the GUI on localhost:631

  • Output order should be specified correctly in PPDs for inkjets and other face-ups

  • lpoptions and lpadmin man pages should note the importance of removing settings (-r or -R respectively) to avoid overriding PPD settings. For example setting outputorder=normal is not the same as deleting the outputorder key; the former will still override the PPD setting.

  • The 'lp' man page should make it clear that '-o outputorder=reverse' will only "print pages in reverse order" on face-down printers. It should also document the possibility of setting '-o outputorder=normal' (which will print pages in reverse order on face-up printers).

  • In 'lp' man page, distinction should be made between options like "page-ranges" which work by filtering the document, and options like "outputorder" which work by overriding printer defaults. It's not obvious to users which kind of option outputorder is. Setting "outputorder=reverse" is not the same as checking the "reverse" box when printing from most GUI applications; the former will only print pages in reverse on face-down printers, while the latter will print them in reverse on any (correctly configured) printer.

  • There should be a "filter"-type 'lp' option (see above) which correctly reverses pages on all printers. It could be named something like "page-order=reverse". This would function just like checking the "reverse" box in a GUI application like Evince or xpdf. It would be used by people who want to, say, print the even pages of a document in reverse order. Currently this cannot be done via the command-line in a printer-independent way.

  • I can't figure out how to remove an outputorder setting using lpoptions "-r". The manual page should tell me what's happening here. Are we looking at the setting from lpadmin?

      $ lpoptions -dHP_Photosmart_Plus_B210a -r outputorder              
      $ lpoptions -dHP_Photosmart_Plus_B210a | tr ' ' '\n'| grep order
      outputorder=reverse
    
  • How do I do the above experiment with 'lpadmin'? It seems to lack the feature to print all the settings. Are they in a file somewhere, can I view the file to look at which options are set? Let's add this feature, or update the lpadmin man page to point users to the file where all the key-value pairs can be viewed.

  • lpadmin should give a warning when user tries to delete a non-existent key, e.g. if the user executes "lpadmin ... -R outputorder" instead of "lpadmin ... -R outputorder-default".

I'm not sure how many of these issues are within your purview. I've tried to do my part as a bug reporter but it seems to be requiring much more work than I had originally budgeted, partly owing to the fact that no one (including the leaders of my distribution, Arch) wants to formally admit the existence of a usability problem.

cups-browsed: undefined symbol: ppdgenerator_msg

This is how I checked out, compiled, installed, and ran the program:

 cups-filters git:(7e69ffa7) ✗ git branch -v
* (HEAD detached at release-1-20-2) 7e69ffa7 cups-filters 1.20.2 Release
  master                            dcc944cf cups-filters 1.20.3 Release
cups-filters git:(7e69ffa7) ✗ ./configure --enable-poppler-cpp && make -j8
sudo make install
cups-browsed --help
cups-browsed: symbol lookup error: cups-browsed: undefined symbol: ppdgenerator_msg

OS:

 uname -a
Linux printerhost 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Printing speed degraded on pdf forms

Note: I have technically not really an idea how cups-filter works. (Or why the potential bug could be related to it) but the developer of the cups project seems to think it could be so:
apple/cups#5242 (comment)
I am just sure that the "symptom" shows on several newer Linux distributions and it doesn't on older ones.

After updating the operating system (and therefore cups and cups-filters) on a test system i recognized that all printouts (of the specific document assembling) from that system are significantly slower than before. (Around 40% on the HP M608DN printer i am using, but the symptom also shows on a range of different network printers i have tested.)

Since this update needs to be done on the production system too this is pretty bad for me because that is the main purpose of that system (it basically prints the whole day through) and so the speed of the whole system will degrade if i do the update. (The printouts are usually done in batches of 3 to 33 document sheets (6 to 66 pages) and always have a combination of documents that show the symptom.)

I think i tracked it down to be related to printing pdf documents with and without form-elements alternating like the following two documents:

test_PDFs_and_protocol.tar.gz

One is a pdf form from /usr/share/cups/data on the newer systems, the other one is an anonymized document created by me (in case the document size or complexity somehow matters).
The exact print command used is contained in the results.txt file.

Here are the printing times of these files on four different Systems. The inner ones are the "new" ones with CUPS 2.x while the old ones use 1.5.x. I added the cups-filers versions too.
The Suse 13.2 system seems to be the only one that doesn't have a cups-filters package installed, but the following two:
cups-filters-foomatic-rip
cups-filters-ghostscript
Both have Versions 1.0.58.

       Ubuntu 12.04  Netrunner/Debian 9     SUSE 42.3        SUSE 13.2
M553:   40 Seconds      76 Seconds          54 Seconds      41 Seconds
M608:   27 Seconds      71 Seconds          41 Seconds      27 Seconds
c-f. vers.    1.0.18              1.16.4-1                  1.8.2               1.0.58 

All Printers tested are network printers, all tests were done multiple times with the same results and the "Ubuntu 12.04" is a live-dvd tested on the same Hardware as the SUSE 42.3 system. (Using the same network, the same printer and the same printer driver ppd.) The viewable problem with the "slow" prints is that the printers always seem to stop and make one ore more little pauses in between while using the old systems it prints the whole bunch through.

PDF forms converted using bannertopdf show gibberish text when the form is edited.

I created a PDF form by converting a PDF-BANNER file. The contents of the banner file are as follows:

#PDF-BANNER
Template form_english.pdf

The file form_english.pdf can be found here.

The banner file is converted to PDF using the following command:

cupsfilter banner_file > OUT.pdf

In the original file, if a field in a form is edited, it gets correctly edited and is reflected in the file. However, in the converted PDF file OUT.pdf, the form fields in the file get filled with gibberish as soon as the field is clicked on, or if tried to be edited. See here sample image. The field 'Task name' was edited and this is the final result:

image

Here is the log for the conversion:

DEBUG: argv[0]="cupsfilter"
DEBUG: argv[1]="1"
DEBUG: argv[2]="sahil"
DEBUG: argv[3]="default"
DEBUG: argv[4]="1"
DEBUG: argv[5]=""
DEBUG: argv[6]="default"
DEBUG: envp[0]="<CFProcessPath>"
DEBUG: envp[1]="CONTENT_TYPE=application/vnd.cups-pdf-banner"
DEBUG: envp[2]="CUPS_DATADIR=/usr/share/cups"
DEBUG: envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
DEBUG: envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
DEBUG: envp[5]="CUPS_SERVERROOT=/etc/cups"
DEBUG: envp[6]="LANG=en_US.UTF8"
DEBUG: envp[7]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
DEBUG: envp[8]="PPD=/usr/share/cups/model/laserjet.ppd"
DEBUG: envp[9]="PRINTER_INFO=cupsfilter"
DEBUG: envp[10]="PRINTER_LOCATION=Unknown"
DEBUG: envp[11]="PRINTER=cupsfilter"
DEBUG: envp[12]="RIP_MAX_CACHE=128m"
DEBUG: envp[13]="USER=sahil"
DEBUG: envp[14]="CHARSET=utf-8"
DEBUG: envp[15]="FINAL_CONTENT_TYPE=application/pdf"
INFO: bannertopdf (PID 11417) started.
DEBUG: Could not open PPD file '/usr/share/cups/model/laserjet.ppd'
Resource dict was changed.
Fill widget name job-id with value 1.
Fill widget name job-title with value default.
Fill widget name user with value sahil.
Fill widget name printer-name with value cupsfilter.
Fill widget name printer-info with value cupsfilter.
Fill widget name time-at-creation with value unknown.
Fill widget name time-at-processing with value unknown.
Lack information for widget: job-originating-host-name.
Fill widget name job-originating-host-name with value N/A.
Lack information for widget: banner-font.
Fill widget name banner-font with value N/A.
Lack information for widget: banner-font-size.
Fill widget name banner-font-size with value N/A.
Lack information for widget: job-uuid.
Fill widget name job-uuid with value N/A.
Lack information for widget: driver.
Fill widget name driver with value N/A.
Lack information for widget: driver-version.
Fill widget name driver-version with value N/A.
Lack information for widget: make-and-model.
Fill widget name make-and-model with value N/A.
Lack information for widget: security-context-user.
Fill widget name security-context-user with value N/A.
Lack information for widget: security-context-range-cur.
Fill widget name security-context-range-cur with value N/A.
Lack information for widget: security-context-type.
Fill widget name security-context-type with value N/A.
INFO: bannertopdf (PID 11417) exited with no errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.