pdftopdf produces unwanted copies

Open
#53 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

Start in cupsfilters/pdftopdf/pdftopdf.cxx around the hw_collate condition and compare the supplied patch with the current code. Reproduce printing with manual_copies off to a PostScript printer, then verify that pdftopdf does not create software copies in addition to the printer's hardware copies.

Written by the indexing model from the issue text.

Description

When manual_copies is off and sending to a PostScript printer, pdftopdf
still produces software copies, resulting in N*N copies.
Issue observed at version 1.28.17 in Debian bookworm, present still in
current "master" version. Patch tested against Debian; below, re-written
for current version (in plain-text and as attached file).

Cheers, Paul

Paul Szabo psz@maths.usyd.edu.au www.maths.usyd.edu.au/u/psz
School of Mathematics and Statistics University of Sydney Australia

--- cupsfilters/pdftopdf/pdftopdf.cxx.ORIG	2024-03-08 04:27:06.000000000 +1100
+++ cupsfilters/pdftopdf/pdftopdf.cxx	2024-04-01 07:01:22.243473122 +1100
@@ -730,9 +730,20 @@
       // of a driverless IPP printer (PDF, Apple Raster, PWG Raster, PCLm).
       // These printers do always hardware collate if they do hardware copies.
       // https://github.com/apple/cups/issues/5433
+      /* PSz  4 Mar 24
+       *  - Surely PostScript printers also can collate? Modern printers
+       *    accept either/both PDF and/or PS, with similar features.
+       *  - Should an inability to collate give us licence to override
+       *    the explicit PPD request of "no sw copies"? An override will
+       *    likely result in N*N copies, when HW does it also.
+       *  - Why pretend to know what the printer can do?
+       * Accepting PostScript also, as a partial (wrong?) fix.
+       */
       hw_collate = (final_content_type &&
 		    (strcasestr(final_content_type, "/pdf") ||
 		     strcasestr(final_content_type, "/vnd.cups-pdf") ||
+		     strcasestr(final_content_type, "/postscript") ||
+		     strcasestr(final_content_type, "/vnd.cups-postscript") ||
 		     strcasestr(final_content_type, "/pwg-raster") ||
 		     strcasestr(final_content_type, "/urf") ||
 		     strcasestr(final_content_type, "/PCLm")));

psz-patch.txt

[Editor's note: Edited for readability]

Dominant language
C
Stars
17
Forks
71
Avg merge
2d 17h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenPrinting/libcupsfilters

All issues in OpenPrinting/libcupsfilters

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.