Bug 1982891

Summary: Printing of banner before PCL file only prints banner
Product: Red Hat Enterprise Linux 8 Reporter: Bryan Mason <bmason>
Component: cupsAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED ERRATA QA Contact: Petr Dancak <pdancak>
Severity: high Docs Contact:
Priority: high    
Version: 8.3CC: ict, pdancak, psklenar
Target Milestone: betaKeywords: AutoVerified, Patch, TestCaseProvided, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cups-2.2.6-41.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1999955 (view as bug list) Environment:
Last Closed: 2022-05-10 15:21:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch
none
Fixed patch none

Description Bryan Mason 2021-07-15 22:58:19 UTC
Description of problem:

  Printing a banner before a PCL file causes only the banner to be
  printed.

Version-Release number of selected component (if applicable):

  cups-2.2.6-38.el8

How reproducible:

  100%

Steps to Reproduce:

 1. lpadmin -p test -m foomatic:HP-LaserJet_4Si-ljet4.ppd -v file:/tmp/test.out -E
 2. lp -d test -o job-sheets=standard <some-pcl-file>

Actual results:

  <some-pcl-file> isn't printed.  Only the banner page is printed.

Expected results:

  Both banne and PCL file should print.

Additional info:

  This was fixed in:

    Raw printing with multiple files and/or banners does not work
    https://github.com/apple/cups/issues/1933

  but unfortunately this commit:

    https://github.com/OpenPrinting/cups/commit/c6e4e712

  which was added to fix:

    https://github.com/apple/cups/issues/4782

  caused a regression resulting in the re-appearance of this issue.

  Test script and proposed patch to follow.

  This likely exists in RHEL 9 and upstream.

Comment 2 Bryan Mason 2021-07-15 23:01:58 UTC
Created attachment 1802121 [details]
Proposed patch

Comment 4 Bryan Mason 2021-07-15 23:13:20 UTC
Created attachment 1802122 [details]
Fixed patch

Oh rats!  Forgot to clean up *~ before running diff.  Fixed in this patch.

Comment 5 Bryan Mason 2021-07-15 23:45:42 UTC
Upstream PR: https://github.com/OpenPrinting/cups/pull/209

Comment 6 Zdenek Dohnal 2021-07-16 08:50:16 UTC
Hi Bryan,

thank you for the investigation, the patch, the test and the upstream PR!

To be honest, I haven't seen anyone yet which would have sent a PCL file to CUPS ... ok, looked into [0] better and it seems it is a variant of this comment[1], where the user sends a postscript file to CUPS, which he got from some scripts...

Would you mind finding out the customer's use case with PCL files? What is his reason for sending PCL files instead of text/PDF files?

I'm asking because such customers are the good candidates for cooperation during testing of hp-printer-app[3] or CUPS ippeveprinter, which will cover printing PCL files to the device.

-------------------------------------------------------------------------------------------

Ad the issue - I can reproduce with your steps, the patch LGTM, I'll verify if it works next week.
Ad the test - I briefly checked your test - I'll try to upstream some parts which can be put in CUPS, however the exact test with banners will need to stay downstream, because it needs banners from cups-filters :( .


[0] https://github.com/apple/cups/issues/5271
[1] https://github.com/apple/cups/issues/5271#issuecomment-708317666
[2] https://github.com/apple/cups/issues/5271#issuecomment-710916833
[3] https://github.com/michaelrsweet/hp-printer-app

Comment 8 Zdenek Dohnal 2021-08-25 12:04:52 UTC
*** Bug 1996102 has been marked as a duplicate of this bug. ***

Comment 21 errata-xmlrpc 2022-05-10 15:21:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cups bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2032