All PDFs when printed come out mirror image

Bug #2018538 reported by Hugo Squelch
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
libppd (Ubuntu)
Fix Released
Undecided
Till Kamppeter
Lunar
Fix Released
Undecided
Unassigned
Mantic
Fix Released
Undecided
Till Kamppeter

Bug Description

Since updating to Ubuntu 23.04. Whenever I try to print a PDF (regardless of application the PDF is open in) it will print the PDF in mirror image.

If I enable printing mirror image in the settings, every other page become mirror image as instead. (I'm printing double sided/long edge print, so one side is normal and the other side becomes mirror image when I do this).

I'm trying to print to a HP Colour LaserJet CP2025dn

Note: If I print from my second device when it was running Ubuntu 22.10 it would print normally, but as soon as I updated it to 23.04, it started having the same issue as well.

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: ubiquity (not installed)
ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6
Uname: Linux 6.2.0-20-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Thu May 4 20:31:48 2023
InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash ---
InstallationDate: Installed on 2022-10-22 (194 days ago)
InstallationMedia: Ubuntu 22.10 "Kinetic Kudu" - Release amd64 (20221020)
SourcePackage: ubiquity
Symptom: installation
UpgradeStatus: Upgraded to lunar on 2023-04-21 (13 days ago)

[ Impact ]

This affects all printers which have an option named "MirrorPrint" in their PPD file. These are typically PostScript printers, especially those from HP. Also Brother PTouch label printers are affected.

Printing is completely impossible without applying special tricks as described in the comments in this bug report.

[ Test plan ]

Download the attached sample PPD file, a file to use the Brother QL-800 label printer with the free software "ptouch-ql" printer driver. Also have a PDF file handy.

No printer is required for the tests, simply check the output file out.pdf whether it is mirrored or not.

Run the following command:

cupsfilter -P QL-800.ppd -m application/vnd.cups-pdf file.pdf > out.pdf

and display the output file with evince.

Also run

cupsfilter -P QL-800.ppd -m application/vnd.cups-pdf -o MirrorPrint=true file.pdf > out.pdf
cupsfilter -P QL-800.ppd -m application/vnd.cups-pdf -o MirrorPrint=false file.pdf > out.pdf

All commands give mirrored output. After installing the proposed SRU package the output is correct, only with "-o MirrorPrint=true" the output gets mirrored.

Who has an affected printer can also test by printing to their print queue, too.

[ Where problems could occur ]

The change is tiny, only an "if" statement was added to check the actual setting (True or False) of the MirrorPrint option got added, to only mirror when te option set to True and not already mirror when the option is just present in the PPD file.

Therefore it is practically impossible that the change causes a regression.

Revision history for this message
Hugo Squelch (nose-gnome) wrote :
affects: ubuntu → ubiquity (Ubuntu)
Steve Langasek (vorlon)
affects: ubiquity (Ubuntu) → cups (Ubuntu)
tags: removed: ubiquity-22.10.10
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cups (Ubuntu):
status: New → Confirmed
Revision history for this message
Dan Stephans (dstephans) wrote :

This behavior also occurs on 23.04 with an HP CP2025. Prior to upgrade printing was great. After upgrade if nothing is touched all pages are mirrored. If the print option is set to mirrored the described behavior in the original report occurs.

Changed in cups (Ubuntu):
assignee: nobody → Till Kamppeter (till-kamppeter)
Revision history for this message
Hugo Squelch (nose-gnome) wrote :

Any updates as to the progress of this bug?

Revision history for this message
Ondrej Maly (chaospace) wrote :

Affects my Brother QL-800 label printer too, just after the upgrade to 23.04. My Xerox Phaser-3010 printer is fine although connected to the same computer.
Setting the printer to mirror-print in settings won't help.

Revision history for this message
Hugo Squelch (nose-gnome) wrote :

In the time being, I've ended up having to use [cpdf](https://github.com/coherentgraphics/cpdf-binaries) to make a mirrored copy of the PDF I want to print. It's not ideal, but at least I can print PDFs I can read them without looking at it through a mirror.

The command I use to flip them is ` ./cpdf -i input.pdf -hflip -o out.pdf `

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Could you attach your print queue's PPD file(s), from /etc/cups/ppd/?

Please do not compress the files, nor package them together. Thanks.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I am not able to reproduce this bug. Could anyone of you please provide me your queue's PPD file from the /etc/cups/ppd/ directory? Thanks.

Could you please also run the command

cupsctl --debug-logging

then print a job which comes out mirrored and after that attach the file

/var/log/cups/error_log

to this bug report? Thanks.

Please attach your files one by one, do not compress them and do not package them together. Thanks.

Changed in cups (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Ondrej Maly (chaospace) wrote :
Revision history for this message
Ondrej Maly (chaospace) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I could reproduce it now with Ondrej's PPD file, thank you very much, Ondrej.

I also found the default PPD file for the HP Colour LaserJet CP2025dn (the PostScript one of HPLIP), the printer of the original poster, Hugo Squelch, thanks, Hugo.

With this I fixed it upstream now:

https://github.com/OpenPrinting/libppd/commit/a86f9993674f1

    All PPD files with "MirrorPrint" option cuased mirrored printout

    If a PPD contains an option "MirrorPrint", the ppdFilterLoadPPD()
    sent the option "mirror=true" to the filter functions, regardless
    of the actual setting of "MirrorPrint" (which is usually "False"
    by default).

    This made all printouts on printers using a PPD file with a
    "MirrorPrint" option coming out mirrored, with no way to counteract
    this by any options or attributes.

    This is fixed now by checking the setting of "MirrorPrint".

Changed in cups (Ubuntu):
status: Incomplete → In Progress
affects: cups (Ubuntu) → libppd (Ubuntu)
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Quick workaround for the time being:

Stop CUPS, edit the PPD file removing, renaming, or commenting out the MirrorPrint option, start CUPS again. Now printing should be correct.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fixed in Mantic in libppd 2.0~rc1-0ubuntu2.

Changed in libppd (Ubuntu Mantic):
status: In Progress → Fix Released
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Hugo, or anyone else affected,

Accepted libppd into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libppd/2:2.0~rc1-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libppd (Ubuntu Lunar):
status: New → Fix Committed
tags: added: verification-needed verification-needed-lunar
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (libppd/2:2.0~rc1-0ubuntu1.1)

All autopkgtests for the newly accepted libppd (2:2.0~rc1-0ubuntu1.1) for lunar have finished running.
The following regressions have been reported in tests triggered by the package:

libppd/2:2.0~rc1-0ubuntu1.1 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/lunar/update_excuses.html#libppd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Manfred Thole (tanfred) wrote :

Tested version libppd2:amd64 (2:2.0~rc1-0ubuntu1.1) by executing "hp-testpage -i", printer is an HP Color LaserJet CP1515n.

The print is correct and not mirrored.

tags: added: verification-done-lunar
removed: verification-needed-lunar
Revision history for this message
Till Kamppeter (till-kamppeter) wrote (last edit ):

Uploaded libppd 2:2.0~rc1-0ubuntu1.2 to fix the mentioned failing autopkgtest. The binary packages produced by it are absolutely identical with 2:2.0~rc1-0ubuntu1.1.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Installed libppd 2:2.0~rc1-0ubuntu1.1 from lunar-proposed and also tested. This fixes the bug as of the results of running the commands under [ Test Plan ] above also for me.

Note that the binary packages produced by libppd 2:2.0~rc1-0ubuntu1.1 and 2:2.0~rc1-0ubuntu1.2 are identical, as the only difference between the packagges is in the autopkgtest script.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Triggering libppd with migration-reference/0 also failed so that's not a regression

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libppd - 2:2.0~rc1-0ubuntu1.1

---------------
libppd (2:2.0~rc1-0ubuntu1.1) lunar; urgency=medium

  * fix-mirrored-printout-when-ppd-has-mirrorprint-option.patch: When
    converting PPDs with “MirrorPrint” option into IPP attributes, setting
    of the option (“True”/“False”) was not considered, making printouts
    always come out mirrored (LP: #2018538).
  * fix-resolution-handling-on-ppd-to-ipp-attr-conversion.patch: For
    PPDs for driverless printers which take jobs in Apple/PWG Raster
    format always the lowest supported resolution got selected, regardless
    of the PPD default or job option settings (LP: #2022929).
  * ppdfilterpstops-fix-printers-with-reverse-output-order.patch:
    Printouts to PostScript printers (or printers with drivers which need
    PostScript input) which drop the pages face-up and therefore need to
    print in reverse order came out empty (Upstream issue #20,
    LP: #2022943).

 -- Till Kamppeter <email address hidden> Tue, 6 Jun 2023 08:59:59 +0200

Changed in libppd (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for libppd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package upload rejected

An upload of libppd to lunar-proposed has been rejected from the upload queue for the following reason: "This needs a new SRU bug about the autopkgtest regression for tracking; changelog currently only points to already-closed bugs".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.