cups-filters: CUPS does not appear to respect the 'cupsManualCopies' PPD parameter when printing AirPrint-supplied jobs with multiple copies
This is with CUPS 2.4.11 and cups-filters 2.0.1, from MacOS 10.14 (I think?) client, and the latest gutenprint snapshot.
Using the Apple preview application, if you tell it to print two copies of a single image, by the time the job passed to the rastertogutenprint filter has two pages, yet the ‘copies’ argument on the filter command line is still 2. The PPD specifies ‘cupsManualCopies: false’ which means the “hardware” (ie not CUPS or its filter chain) is responsible for generating copies.
I can’t be sure the problem isn’t with the Apple preview application or MacOS’s AirPrint client implementation, but I do not consider that likely.
Attached are:
- Comprehensive ‘LogLevel debug’ logs covering the entire job from submission to completion
- PPD
- IPP get-attrs
Here’s an excerpt of the logs, showing the arguments passed to the filters:
[Job 216] 3 filters for job:
[Job 216] - (application/pdf to application/vnd.universal-input, cost 0)
[Job 216] universal (application/vnd.universal-input to application/vnd.cups-raster, cost 0)
[Job 216] rastertogutenprint.5.3 (application/vnd.cups-raster to printer/U826, cost 100)
[Job 216] job-sheets=none,none
[Job 216] argv[0]="U826"
[Job 216] argv[1]="216"
[Job 216] argv[2]="USERNAMEHIDDEN"
[Job 216] argv[3]="20090117 IMG_7901.JPG"
[Job 216] argv[4]="2"
[Job 216] argv[5]="<cut out see below>"
[Job 216] argv[6]="/var/spool/cups/d00216-001"
[Job 216] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
[Job 216] envp[1]="CUPS_DATADIR=/usr/share/cups"
[Job 216] envp[2]="CUPS_DOCROOT=/usr/share/cups/www"
[Job 216] envp[3]="CUPS_REQUESTROOT=/var/spool/cups"
[Job 216] envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
[Job 216] envp[5]="CUPS_SERVERROOT=/etc/cups"
[Job 216] envp[6]="CUPS_STATEDIR=/run/cups"
[Job 216] envp[7]="HOME=/var/spool/cups/tmp"
[Job 216] envp[8]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
[Job 216] envp[9]="SERVER_ADMIN=root@spatula.fl.shaftnet.org"
[Job 216] envp[10]="SOFTWARE=CUPS/2.4.11"
[Job 216] envp[11]="TMPDIR=/var/spool/cups/tmp"
[Job 216] envp[12]="USER=root"
[Job 216] envp[13]="CUPS_MAX_MESSAGE=2047"
[Job 216] envp[14]="CUPS_SERVER=/run/cups/cups.sock"
[Job 216] envp[15]="CUPS_ENCRYPTION=IfRequested"
[Job 216] envp[16]="IPP_PORT=631"
[Job 216] envp[17]="CHARSET=u (application/pdftf-8"
[Job 216] envp[18]="LANG=en_US.UTF-8"
[Job 216] envp[19]="PPD=/etc/cups/ppd/U826.ppd"
[Job 216] envp[20]="CONTENT_TYPE=application/pdf"
[Job 216] envp[21]="DEVICE_URI=gutenprint53+usb://joyspace-u826/4FC3B1084248015"
[Job 216] envp[22]="PRINTER_INFO=Joyspace U826"
[Job 216] envp[23]="PRINTER_LOCATION=Office"
[Job 216] envp[24]="PRINTER=U826"
[Job 216] envp[25]="PRINTER_STATE_REASONS=none"
[Job 216] envp[26]="CUPS_FILETYPE=document"
[Job 216] envp[27]="FINAL_CONTENT_TYPE=application/vnd.cups-raster"
[Job 216] envp[28]="AUTH_I****"
[Job 216] Started filter /usr/lib/cups/filter/universal (PID 2482)
[Job 216] Started filter /usr/lib/cups/filter/rastertogutenprint.5.3 (PID 2483)
[Job 216] Started backend /usr/lib/cups/backend/gutenprint53+usb (PID 2484)
[Job 216] ppdFilterUniversal: \"*cupsFilter(2): ...\" lines in the PPD file:
[Job 216] ppdFilterUniversal: application/vnd.cups-raw application/octet-stream 0 -
[Job 216] ppdFilterUniversal: application/vnd.cups-command 33 commandtodyesub
[Job 216] ppdFilterUniversal: PPD uses \"*cupsFilter: ...\" lines, so we always convert to format given by FINAL_CONTENT_TYPE
[Job 216] ppdFilterUniversal: Converting from application/pdf to application/vnd.cups-raster
[Job 216] cfFilterUniversal: Converting from application/pdf to application/vnd.cups-raster
[Job 216] cfFilterUniversal: Final output format for job: application/vnd.cups-raster
[Job 216] cfFilterUniversal: Adding pdftopdf to chain
[Job 216] cfFilterUniversal: Adding ghostscript to chain
[Job 216] cfFilterChain: Running filter: pdftopdf
[Job 216] Gutenprint: 5.3.4 Starting
[Job 216] Gutenprint: command line: U826 \'216\' \'USERNAMEHIDDEN\' \'20090117 IMG_7901.JPG\' \'2\' <args>
[Job 216] Gutenprint: using PPD file /etc/cups/ppd/U826.ppd
[Job 216] Gutenprint: CUPS option count is 66 (4332 bytes)
[Job 216] Gutenprint: CUPS option 0 AP_ColorMatchingMode = AP_ApplicationColorMatching
[Job 216] Gutenprint: CUPS option 1 AP_D_InputSlot =
[Job 216] Gutenprint: CUPS option 2 collate = true
[Job 216] Gutenprint: CUPS option 3 ColorModel = RGB
[Job 216] Gutenprint: CUPS option 4 com.apple.print.DialogDismissedBy = Print
[Job 216] Gutenprint: CUPS option 5 com.apple.print.DocumentTicket.PMSpoolFormat = application/pdf
[Job 216] Gutenprint: CUPS option 6 com.apple.print.JobInfo.PMApplicationName = Preview
[Job 216] Gutenprint: CUPS option 7 com.apple.print.JobInfo.PMJobName = 20090117 IMG_7901.JPG
[Job 216] Gutenprint: CUPS option 8 com.apple.print.JobInfo.PMJobOwner = System Administrator
[Job 216] Gutenprint: CUPS option 9 com.apple.print.PageToPaperMappingAllowScalingUp..b. = true
[Job 216] Gutenprint: CUPS option 10 com.apple.print.PageToPaperMappingMediaName = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 11 com.apple.print.PageToPaperMappingType..n. = 1
[Job 216] Gutenprint: CUPS option 12 com.apple.print.PDEsUsed = com.apple.print.pde.MediaQualityPDEKind, com.apple.print.pde.NSPrintAccessoryViewPDE,
[Job 216] Gutenprint: CUPS option 13 com.apple.print.PMPresetUsed = 4x6 prints
[Job 216] Gutenprint: CUPS option 14 com.apple.print.preset.Orientation..n. = 1
[Job 216] Gutenprint: CUPS option 15 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPageRect..a.0..n. = 0
[Job 216] Gutenprint: CUPS option 16 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPageRect..a.1..n. = 0
[Job 216] Gutenprint: CUPS option 17 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPageRect..a.2..n. = 442.57321166992188
[Job 216] Gutenprint: CUPS option 18 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPageRect..a.3..n. = 297.60940551757812
[Job 216] Gutenprint: CUPS option 19 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPaperRect..a.0..n. = 0
[Job 216] Gutenprint: CUPS option 20 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPaperRect..a.1..n. = 0
[Job 216] Gutenprint: CUPS option 21 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPaperRect..a.2..n. = 442.57321166992188
[Job 216] Gutenprint: CUPS option 22 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PageFormat.PMAdjustedPaperRect..a.3..n. = 297.60940551757812
[Job 216] Gutenprint: CUPS option 23 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMCustomPaper..b. = false
[Job 216] Gutenprint: CUPS option 24 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMPaperName = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 25 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPageRect..a.0..n. = 0
[Job 216] Gutenprint: CUPS option 26 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPageRect..a.1..n. = 0
[Job 216] Gutenprint: CUPS option 27 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPageRect..a.2..n. = 442.57321166992188
[Job 216] Gutenprint: CUPS option 28 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPageRect..a.3..n. = 297.60940551757812
[Job 216] Gutenprint: CUPS option 29 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPaperRect..a.0..n. = 0
[Job 216] Gutenprint: CUPS option 30 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPaperRect..a.1..n. = 0
[Job 216] Gutenprint: CUPS option 31 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPaperRect..a.2..n. = 442.57321166992188
[Job 216] Gutenprint: CUPS option 32 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.PMUnadjustedPaperRect..a.3..n. = 297.60940551757812
[Job 216] Gutenprint: CUPS option 33 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.PaperInfo.ppd.PMPaperName = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 34 com.apple.print.preset.PaperInfo..d.paperInfo..d.com.apple.print.ticket.type = com.apple.print.PaperInfoTicket
[Job 216] Gutenprint: CUPS option 35 com.apple.print.preset.PaperInfo..d.paperInfo..d.PMPPDPaperCodeName = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 36 com.apple.print.preset.PaperInfo..d.paperInfo..d.PMPPDTranslationStringPaperName = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 37 com.apple.print.preset.PaperInfo..d.paperInfo..d.PMTiogaPaperName = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 38 com.apple.print.PrinterInfo.PMColorDeviceID..n. = 7385
[Job 216] Gutenprint: CUPS option 39 com.apple.print.PrintSettings.PMColorSpaceModel..n. = 2
[Job 216] Gutenprint: CUPS option 40 com.apple.print.PrintSettings.PMCopies..n. = 2
[Job 216] Gutenprint: CUPS option 41 com.apple.print.PrintSettings.PMCopyCollate..b. = true
[Job 216] Gutenprint: CUPS option 42 com.apple.print.PrintSettings.PMDestinationType..n. = 1
[Job 216] Gutenprint: CUPS option 43 com.apple.print.PrintSettings.PMDuplexing..n. = 1
[Job 216] Gutenprint: CUPS option 44 com.apple.print.PrintSettings.PMFirstPage..n. = 1
[Job 216] Gutenprint: CUPS option 45 com.apple.print.PrintSettings.PMLastPage..n. = 2147483647
[Job 216] Gutenprint: CUPS option 46 com.apple.print.PrintSettings.PMPageRange..a.0..n. = 1
[Job 216] Gutenprint: CUPS option 47 com.apple.print.PrintSettings.PMPageRange..a.1..n. = 2147483647
[Job 216] Gutenprint: CUPS option 48 com.apple.print.PrintSettings.PMTotalBeginPages..n. = 1
[Job 216] Gutenprint: CUPS option 49 com.apple.print.PrintSettings.PMTotalSidesImaged..n. = 2
[Job 216] Gutenprint: CUPS option 50 com.apple.print.totalPages..n. = 1
[Job 216] Gutenprint: CUPS option 51 date-time-at-creation =
[Job 216] Gutenprint: CUPS option 52 date-time-at-processing =
[Job 216] Gutenprint: CUPS option 53 DestinationPrinterID = Joyspace_U826
[Job 216] Gutenprint: CUPS option 54 document-name-supplied = 20090117 IMG_7901.JPG
[Job 216] Gutenprint: CUPS option 55 Duplex = None
[Job 216] Gutenprint: CUPS option 56 job-originating-host-name = 192.168.10.193
[Job 216] Gutenprint: CUPS option 57 job-uuid = urn:uuid:d5e6f44e-834b-3b82-58ee-9711f35624c7
[Job 216] Gutenprint: CUPS option 58 media = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 59 PageSize = 104.99x156.13mm
[Job 216] Gutenprint: CUPS option 60 PaperInfoIsSuggested..b. = true
[Job 216] Gutenprint: CUPS option 61 PDFIsProtected..b. = false
[Job 216] Gutenprint: CUPS option 62 pserrorhandler-requested = standard
[Job 216] Gutenprint: CUPS option 63 sides = one-sided
[Job 216] Gutenprint: CUPS option 64 time-at-creation = 1735673751
[Job 216] Gutenprint: CUPS option 65 time-at-processing = 1735673753
[Job 216] cfFilterGhostscript: Processing page 1...
[Job 216] cfFilterGhostscript: Processing page 2...
It shows that MacOS is requesting two copies of one page, but it looks like the universal filter’s pdftopdf step is apparently doubling this up to two pages, passing that to ghostscript, before eventually sending that to rastertogutenprint (which takes the ‘copies’ argument from the command line and tells the printer to generate two copies)
I haven’t figured out how to enable more verbose debugging of the pdftopdf or ghostscript filters yet, if I can I’ll update this with more info.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (4 by maintainers)
@ValdikSS As a raster driver (filter), you look at NumCopies and generate copies if NumCopies > 1. This should always work as expected with the usual cups-filters and when you (as the driver developer) provide the correct values in the PPD file.
I say “you can’t depend on NumCopies” to know whether a job is producing multiple copies. All it tells you is, as a driver filter, whether you need to produce an (uncollated) copy of this page - nothing more, nothing less.
The Gutenprint backend should only be producing copies of files supplied on the command-line (“raw” printing) and otherwise not producing copies at all. It is up to the Gutenprint raster filter to do any (uncollated) copy generation.