cups-filters icon indicating copy to clipboard operation
cups-filters copied to clipboard

CUPS 2.4.1 label printing is sideways across multiple labels (2.3.1 worked fine)

Open derekatkins opened this issue 8 months ago • 9 comments

Describe the bug I've been running a label printer off ubuntu 20.04 with a custom PPD file, driving the labels from a java application, and it's been working great for years. I am now working on upgrading the application from ubuntu 20.04 to 22.04 which upgrades CUPS from 2.3.1 to 2.4.1, and now the labels are printed 90 degrees off and across multiple labels!

More specifically, the labels we have are landscape mode (2" x 1"). With the upgrade to 2.4.1, the 2x1 image is now printed in portrait mode across 3 labels (and using 4 in the process). The only change has been to CUPS and the OS.

I just tried a clean installation (to see if it's an upgrade problem), but the fresh install of our application onto UB22.04 has the same issue as the upgrade from 20.04.

To Reproduce Steps to reproduce the behavior (NB: It might be hard for you to reproduce this on your own because the label is sourced from our java application, and I cannot share that):

  1. Run our application on UB22.04
  2. Print a label
  3. Printer outputs in portrait mode across multiple physical labels.

Expected behavior I did not expect a change in portrait vs landscape mode in an upgrade from 2.3.1 to 2.4.1. I expected my PPD and application

Screenshots Image

cups_error_log.txt

TD-4520TN.ppd.txt

System Information:

  • Ubuntu 22.04
  • a custom Java application
  • CUPS version 2.4.1 (2.4.1op1-1ubuntu4.11)

Additional context This might be related to Issue #1003 but you closed that without resolution.
I have attached the PPD file as well as the error_log

derekatkins avatar Apr 01 '25 13:04 derekatkins

No media size is specified, and the default in the PPD file is 2x4 inches...

michaelrsweet avatar Apr 01 '25 15:04 michaelrsweet

So any idea why this worked on 2.3.1 but doesn't work on 2.4.1? I suppose I can try to get an error_log from 2.3.1 to compare, if that would help?

derekatkins avatar Apr 01 '25 16:04 derekatkins

@derekatkins The error_log and PPD file, yes. Note there are probably also differences in the print filters between the two releases of Ubuntu but the key problem here is that the default media size is 2x4 inches...

michaelrsweet avatar Apr 01 '25 17:04 michaelrsweet

The PPD file is exactly the same. I'll work on the error log

derekatkins avatar Apr 01 '25 18:04 derekatkins

Sorry for the delay; I spent some time trying to install onto ubuntu 24.04 to see if the problem went away (note: it did not). So I finally got back to getting the error log on ub20 (cups 2.3.1). And... Interesting. in 2.3.1 I see that there is a request for orientation in the gstopdf call:

D [02/Apr/2025:08:58:10 -0400] [Job 106] gstopdf argv[6] = 106 ubuntu Java Printing 1 finishings=3 number-up=1 orientation-requested=3 job-uuid=urn:uuid:e80d4387-7629-3eac-5ee1-d950fef66812 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1743598690 time-at-processing=1743598690 document-name-supplied=javaprint15915413010548202552.ps /var/spool/cups/d00106-001

I do not see this in the 2.4.1 logs:

D [01/Apr/2025:08:56:57 -0400] [Job 2] gstopdf argv[6] = 2 ubuntu Java Printing 1 finishings=3 number-up=1 print-color-mode=monochrome job-uuid=urn:uuid:20a7e6b1-4071-35bd-6fe8-7efb1137c2b3 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1743512200 time-at-processing=1743512217 document-name-supplied=javaprint7437381776636927264.ps /var/spool/cups/d00002-001

So, where is this coming from?

cups_error_log_2.3.1.txt

derekatkins avatar Apr 02 '25 13:04 derekatkins

@derekatkins Can you try the following:

lpadmin -p PRINTERNAME -o orientation-requested-default=3

michaelrsweet avatar Apr 02 '25 13:04 michaelrsweet

@michaelrsweet Tried that, but it doesn't change the output to the label printer. it did add that to the gstopdf, but the output is still rotated as before the lpadmin (without the orientation request):

D [02/Apr/2025:10:03:15 -0400] [Job 2] gstopdf argv[6] = 2 ubuntu Java Printing 1 finishings=3 number-up=1 orientation-requested=3 print-color-mode=monochrome job-uuid=urn:uuid:5b9930aa-071e-3a13-49eb-bb181e1e2f48 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1743602595 time-at-processing=1743602595 document-name-supplied=javaprint3688316163098105653.ps /var/spool/cups/d00002-001

Full debug log after the lpadmin: cups_error_log-2.4.1.txt

So clearly that orientation request is not the issue here.

derekatkins avatar Apr 02 '25 14:04 derekatkins

OK, let's move this discussion over to the cups-filters project since this is likely a change/regression in that component.

michaelrsweet avatar Apr 02 '25 14:04 michaelrsweet

@michaelrsweet any other suggestions for tests I can make? I'll note that it doesn't seem to matter whether I install directly onto UB22 or upgrade from UB20 -> UB22, the result is the same. Thanks!

derekatkins avatar Apr 02 '25 17:04 derekatkins