]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
pdftops: Identify old LaserJets more precisely for swicth to Poppler
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 5 Apr 2022 16:36:56 +0000 (18:36 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 5 Apr 2022 16:36:56 +0000 (18:36 +0200)
Old HP LaserJet printers have a firmware bug which makes them not
working with Ghostscript's PostScript output, so in pdftops() we
switch to Poppler for them.

Old HP LaserJet printers have a firmware bug which makes them not
working with Ghostscript's PostScript output, so in pdftops() we
switch to Poppler for them.

We consider an old LaserJet every "HP LaserJet XXXXY" printer with
XXXX being a number (not preceded by a letter), typically 1-4 digits
and Y being 0-2 letters, no separated from the numbers by a space.

Unfortunately, we checked only whether after "LaserJet" comes a number
and not the rest. This made also modern printers with names like "HP
LaserJet 500 color M551" considered old and these modern printers have
another PostScript interpreter bug which makes them not print some
files with Poppler, so they need Ghostscript's PostScript output.

Therefore we refine the check for the old-LaserJet quirk to see
whether after the number are extra words and if so, this is again a
modern printer and we do not switch to Poppler.

See https://bugs.launchpad.net/bugs/1967816

(manually backported from commit 607f5e90660c171d26ba0f706079a5babb4c5cc9)

NEWS
filter/pdftops.c

diff --git a/NEWS b/NEWS
index 6a772161f1370f9cc94ceaec54012149529113c5..bb10535fb57840d7840410cb078a4ce5108b32f1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
 NEWS - OpenPrinting CUPS Filters v1.28.14 - 2022-04-04
 ------------------------------------------------------
 
+CHANGES IN V1.28.15
+
+       - pdftops: In pdftops identify old LaserJets more precisely
+         for working around PostScript interpreter bugs, older
+         printers need Poppler, newer models need Ghostscript
+         (Ubuntu bug #1967816).
+
 CHANGES IN V1.28.14
 
        - pdftopdf: Correct the output when suppressing auto-rotation
index 4d4688bd5a21d16fb7d8e1000e8fc817bfa97fac..1bfe1a2c7d61c6e004a5c0e6450d0ee087ed9bf9 100644 (file)
@@ -520,8 +520,12 @@ main(int  argc,                            /* I - Number of command-line args */
        if (isspace(*ptr)) continue;
        if (isdigit(*ptr))
        {
-         fprintf(stderr, "DEBUG: Switching to Poppler's pdftops instead of Ghostscript for old HP LaserJet (\"LaserJet <number>\", no letters before <number>) printers to work around bugs in the printer's PS interpreters\n");
-         renderer = PDFTOPS;
+         while (*ptr && isalnum(*ptr)) ptr ++;
+         if (!*ptr) /* End of string, no further word */
+         {
+           fprintf(stderr, "DEBUG: Switching to Poppler's pdftops instead of Ghostscript for old HP LaserJet (\"LaserJet <number>\", no letters before <number>, no additional words after <number>) printers to work around bugs in the printer's PS interpreters\n");
+           renderer = PDFTOPS;
+         }
        }
        break;
       }