cups icon indicating copy to clipboard operation
cups copied to clipboard

Duplex printing only in landscape mode available

Open Dewellop opened this issue 1 year ago • 1 comments

Setup CUPS on XFCE for HP Color LaserJet Pro MFP 4302dw works fine. But when I choose duplexprinting it always binds in landscape format, even I have choosen portrait in the printing dialog. Also toggeling between portrait and landscape it always prints in landscape mode.

There is no problem in toggeling the printing modes with the driver on Windows 10, so it seems to be a problem of CUPS.

Regards, Rainer

Dewellop avatar Jun 11 '24 13:06 Dewellop

Please provide CUPS version, turn on debug logging, reproduce the issue and attach debug logs and PPD file for your printer from /etc/cups/ppd.

zdohnal avatar Jun 11 '24 14:06 zdohnal

Sorry lasts some time:

UbuntuVersion.txt

CUPS-Version: 2.4.1

MFP4302_DS_LE_errlog.txt

The /etc/cups/ppd path is empty.

Dewellop avatar Jul 14 '24 13:07 Dewellop

Another remark: my issue don't target Landscape/Portait printing orientation, but the binding orientation!

Dewellop avatar Jul 14 '24 15:07 Dewellop

I'm sorry it is the debug log from system-config-printer, not CUPS debug logs - when you file the issue, there is a link to our document, where it is described how to enable logs and how to gather them - https://github.com/OpenPrinting/cups/blob/master/REPORTING_ISSUES.md . It would be great if you provided CUPS logs when you print the job.

@michaelrsweet IIUC binding orientation is what IPP attribute finishings decides, correct?

zdohnal avatar Jul 15 '24 07:07 zdohnal

tell us what is your OS See above, please

tell us your CUPS version 2.4.1

in case you compile CUPS by yourself, tell us all configuration options you pass into ./configure Not modified

describe the problem See above, please

mention your printer model See above, please

try to narrow the issue if possible: check how the printing works via CUPS CLI tools, f.e.: See whether the printer is available (f.e. in case the printer is not shown in application) - shows both temporary and permanent queues:

$ lpstat -l -e

HP-Color-LaserJet-Pro-MFP-4302 permanent ipp://localhost/printers/HP-Color-LaserJet-Pro-MFP-4302 dnssd://HP%20Color%20LaserJet%20Pro%20MFP%204302%20%5BD57045%5D._ipp._tcp.local/?uuid=3127a56a-54aa-4a53-b105-794f47d1e9fb HP_Color_LaserJet_Pro_MFP_4302_D57045 network none ipps://HP%20Color%20LaserJet%20Pro%20MFP%204302%20%5BD57045%5D._ipps._tcp.local/ See its available options (in case an application doesn't show some options):

$ lpoptions -p HP_LaserJet_M1536dnf_MFP_42307C -l

PageSize/Media Size: 100x150mm 184x260mm 195x270mm 4x6 5x8 *A4 A5 A6 B5 B6 Env10 EnvC5 EnvDL EnvMonarch Executive FanFoldGermanLegal ISOB5 Legal Letter Oficio Postcard Statement roc16k Custom.WIDTHxHEIGHT InputSlot/Media Source: *Auto Tray1 Tray2 MediaType/Paper Type: Cardstock Com.hpTrifoldBrochureGlossy150gsm Com.hp.EcoSMARTLite Com.hp.cardstockGlossy Com.hp.extraHeavy Com.hp.extraHeavyGloss Com.hp.filmOpaque Com.hp.glossy130gsm Com.hp.glossy160gsm Com.hp.glossy220gsm Com.hp.heavyGlossy Com.hp.heavyRough Com.hp.intermediate Com.hp.matte105gsm Com.hp.matte120gsm Com.hp.matte160gsm Com.hp.matte200gsm Com.hp.matte90gsm Com.hp.midweight Com.hp.recycled Com.hp.rough Envelope EnvelopeHeavyweight Labels *Stationery StationeryBond StationeryColored StationeryHeavyweight StationeryLetterhead StationeryLightweight StationeryPreprinted StationeryPrepunched Transparency ColorModel/Print Color Mode: *RGB Gray DeviceGray DeviceRGB AdobeRGB Duplex/2-Sided Printing: *None DuplexNoTumble DuplexTumble OutputBin/Output Tray: *FaceDown cupsPrintQuality/Print Quality: *Normal High print-content-optimize/Print Optimization: *auto graphics photo text text-and-graphics print-rendering-intent/Print Rendering Intent: absolute *auto perceptual relative relative-bpc saturation print-scaling/Print Scaling: *auto auto-fit fill fit none

Print a file to a printer with specific options (in case the printout from application is incorrect - print the same file and set the same options as you did in application, in case they are seen in lpoptions), f.e. to check duplex printing on a document you want to print (put the path to the document instead of ):

lp -d HP-Color-LaserJet-Pro-MFP-4302 -o Duplex=DuplexNoTumble Dokumente/Ideen/DuplexTest.pdf

Leads to tumbled(landscape-Binding?) printout.

lp -d HP-Color-LaserJet-Pro-MFP-4302 -o Duplex=DuplexTumble Dokumente/Ideen/DuplexTest.pdf Leads also to tumbled(landscape-Binding?) printout.

check if the issue happens with different documents yes

check if the issue happens when using different applications yes

in case you use mDNS hostnames (hostnames with .local), check mDNS resolution by pinging such hostname - mDNS is used for temporary queues (printers which are seen by lpstat -e, but not by lpstat -a) or for permanent queues which have .local in its URI (check lpstat -a). However the hostname from URI is not resolvable as it is, you need to get usual printer's mDNS hostname from hostname entry in avahi-browse -avrt output. Rule of thumb: Didn't use mDNS hostnames

in case printing works from CUPS CLI tools or CUPS Web UI, but not via an application, file the issue to the application for the initial investigation. in case mDNS resolution doesn't work and you use driverless printing or mDNS hostnames in CUPS, file the issue to your mDNS resolution provider - it can be nss-mdns or systemd-resolved depending on your configuration. turn on CUPS debug logging:

$ cupsctl LogLevel=debug2

reproduce the issue

collect the logs - the logs can be in /var/log/cups/error_log or in journalctl:

For error_log:

$ sudo cp /var/log/cups/error_log ~/error_log.txt
$ sudo chmod 666 ~/error_log.txt

For journalctl:

$ journalctl -u cups --since=today > log.txt

and attach the file to the GitHub issue. /var/log/cups/error_log is empty relevant output of journalctl: Jul 17 21:31:52 rossi-K50IJ systemd[1]: cups.service: Main process exited, code=exited, status=1/FAILURE Jul 17 21:31:52 rossi-K50IJ systemd[1]: cups.service: Failed with result 'exit-code'. Jul 17 21:31:52 rossi-K50IJ systemd[1]: cups.service: Consumed 4.312s CPU time. Jul 17 21:31:52 rossi-K50IJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 1. Jul 17 21:32:09 rossi-K50IJ systemd[1]: Stopped CUPS Scheduler. Jul 17 21:32:09 rossi-K50IJ systemd[1]: cups.service: Consumed 4.312s CPU time. Jul 17 21:32:09 rossi-K50IJ systemd[1]: Starting CUPS Scheduler... Jul 17 21:32:10 rossi-K50IJ systemd[1]: Started CUPS Scheduler.

provide output of lpstat -e, lpstat -t and lpinfo -v lpstat -e | lpstat -t | lpinfo -v file cups-brf:/ network http network beh network https network ipp network ipps network socket network lpd direct hp network dnssd://HP%20Color%20LaserJet%20Pro%20MFP%204302%20%5BD57045%5D._ipp._tcp.local/?uuid=3127a56a-54aa-4a53-b105-794f47d1e9fb direct hpfax network ipps://HP%20Color%20LaserJet%20Pro%20MFP%204302%20%5BD57045%5D._ipps._tcp.local/

provide PPD file from /etc/cups/ppd if exists for the printer empty

provide the file you are trying to print, if the issue happens with a specific file no specific file

provide the d file from /var/spool/cups - this is the file CUPS actually gets from the application cannot "cd" to /var/spool/cups?

tell us the name of application where you experience the problem All Apps

if needed, turn off the debug logging by:

$ cupsctl LogLevel=warn

I hope we've now gathered enough and right infos.... pooh!!! :-)

Dewellop avatar Jul 17 '24 19:07 Dewellop

Bindingorientation can also been named as longsided or shortsided!

Dewellop avatar Jul 17 '24 20:07 Dewellop

Still, if there is no logs, I can't do much - what is ErrorLog value in /etc/cups/cups-files.conf? If you enabled the debug logs in cupsd.conf and reproduced the issue, the logs have to be where the ErrorLog directive says to be, and Ubuntu AFAIK puts it into /var/log/cups/error_log or similar.

Please look into logging once more and provide the debug logs when you print.

zdohnal avatar Jul 18 '24 06:07 zdohnal

mmmhhhh, perhaps this file will be the right one....

error_log.txt

Dewellop avatar Jul 18 '24 18:07 Dewellop

perhaps I should complement: portrait binding = long edge binding = duplex no tumble

Dewellop avatar Jul 18 '24 19:07 Dewellop

Ok, when I see the logs - here are the options set by cupsd:

D [18/Jul/2024:20:46:41 +0200] [Job 326] job-sheets=none,none
D [18/Jul/2024:20:46:41 +0200] [Job 326] print-color-mode=color, print-quality=normal
D [18/Jul/2024:20:46:41 +0200] [Job 326] Adding preset option cupsPrintQuality=Normal
d [18/Jul/2024:20:46:41 +0200] [Job 326] After mapping finishings cupsPrintQuality=Normal

here are options sent by the application:

D [18/Jul/2024:20:46:41 +0200] [Job 326] argv[5]="printer-state-reasons=media-empty-report printer-is-accepting-jobs Resolution=600dpi marker-types=toner-cartridge,toner-cartridge,toner-cartridge,toner-cartridge PageSize=A4 printer-is-shared marker-low-levels=8,15,15,15 marker-colors=#000000,#00FFFF,#FF00FF,#FFFF00 printer-location= marker-levels=90,90,90,90 Duplex=DuplexNoTumble Collate marker-names=black\\\\\\ cartridge,cyan\\\\\\ cartridge,magenta\\\\\\ cartridge,yellow\\\\\\ cartridge printer-state=3 device-uri=dnssd://HP%20Color%20LaserJet%20Pro%20MFP%204302%20%5BD57045%5D._ipp._tcp.local/?uuid=3127a56a-54aa-4a53-b105-794f47d1e9fb printer-uri-supported=ipp://localhost/printers/HP-Color-LaserJet-Pro-MFP-4302 ColorModel=RGB print-color-mode=color printer-type=168028 printer-commands=none printer-state-change-time=1721244835 noprinter-is-temporary marker-change-time=1721244819 number-up=1 finishings=3 marker-high-levels=100,100,100,100 job-uuid=urn:uuid:505d508c-26d4-390c-6b11-b8e4db299de0 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1721328401 time-at-processing=1721328401 cupsPrintQuality=Normal"

and here are attributes sent to the printer:

D [18/Jul/2024:20:46:45 +0200] [Job 326] Create-Job IPP/2.0
D [18/Jul/2024:20:46:45 +0200] [Job 326] printer-uri=\"ipp://HP644ED7D57045.local:631/ipp/print\"
D [18/Jul/2024:20:46:45 +0200] [Job 326] requesting-user-name=\"rossi\"
D [18/Jul/2024:20:46:45 +0200] [Job 326] job-name=\"DuplexTest.pdf\"
D [18/Jul/2024:20:46:45 +0200] [Job 326] Adding standard IPP operation/job attributes.
D [18/Jul/2024:20:46:45 +0200] [Job 326] IPP/2.0 Create-Job #3
D [18/Jul/2024:20:46:45 +0200] [Job 326] ---- operation-attributes-tag ----
D [18/Jul/2024:20:46:45 +0200] [Job 326] attributes-charset charset utf-8
D [18/Jul/2024:20:46:45 +0200] [Job 326] attributes-natural-language naturalLanguage de-de
D [18/Jul/2024:20:46:45 +0200] [Job 326] printer-uri uri ipp://HP644ED7D57045.local:631/ipp/print
D [18/Jul/2024:20:46:45 +0200] [Job 326] requesting-user-name nameWithoutLanguage rossi
D [18/Jul/2024:20:46:45 +0200] [Job 326] job-name nameWithoutLanguage DuplexTest.pdf
D [18/Jul/2024:20:46:45 +0200] [Job 326] ---- job-attributes-tag ----
D [18/Jul/2024:20:46:45 +0200] [Job 326] media-col collection {media-size={x-dimension=21000 y-dimension=29700} media-top-margin=423 media-left-margin=423 media-right-margin=423 media-bottom-margin=423}
D [18/Jul/2024:20:46:45 +0200] [Job 326] output-bin keyword face-down
D [18/Jul/2024:20:46:45 +0200] [Job 326] print-color-mode keyword color
D [18/Jul/2024:20:46:45 +0200] [Job 326] print-quality enum normal
D [18/Jul/2024:20:46:45 +0200] [Job 326] sides keyword two-sided-long-edge
D [18/Jul/2024:20:46:45 +0200] [Job 326] multiple-document-handling keyword separate-documents-collated-copies
D [18/Jul/2024:20:46:45 +0200] [Job 326] ---- end-of-attributes-tag ----

I can see there is DuplexNoTumble and sides two-sided-long-edge, which do portrait duplex, but nothing regarding binding - AFAIK something regarding binding is available in finishings attribute, but that's set to 3 (none) by the application.

@michaelrsweet is there a specific attribute/PPD option related to binding? I've checked IPP RFC and saw its mention in finishings attribute, but nothing else...

@Dewellop either way, whether there is a specific binding attribute/PPD options, or whether it is under finishings attribute, your application does not send it or sends it with value "none".

zdohnal avatar Jul 19 '24 06:07 zdohnal

@zdohnal Don't know what you mean with "your application". All apps that uses cups doesn't seem to send the right attributes to the printer... eg. LibreOffice, Gimp, PDF-viewer from chromium

Dewellop avatar Jul 19 '24 18:07 Dewellop

The issue is that all apps don't send the option to CUPS, if there is any - but I'm not sure if there is any except for sides/Duplex. Additonally, your CUPS version is quite old, so I suspect your system is old too - there is possibility that the issue is fixed in newer CUPS or in packages related to it.

Can you scan the output pages and attach them here, where the landscape (short edge binding) is applied when you ask for portrait (long edge binding)?

zdohnal avatar Jul 22 '24 06:07 zdohnal

If the issue is about the text in duplex printing is being printed as it is for landscape format (the pages turn over by the short edge of paper) instead of the requested portrait format (turning over the long edge), then it works for me with CUPS 2.4.10 and cups-filters 2.0.0.

If the issue is really about this - I hope I will be sure after I see the scans - then I'll close the issue since it can't be reproduced with the latest versions.

zdohnal avatar Jul 22 '24 07:07 zdohnal

OK, the cups-version 2.4.1 I took from [MFP4302_DS_LE_errlog.txt], but output of snap list --all is: cups 2.4.10-1 1058 latest/stable openprinting✓ - so it seems to be the latest version

All current updates of the system 22.04.4 LTS are implemented

cupsfilter --list-filters only leads to options list, like cups-filters --help

Don't understand what you mean with scanning the printout of the duplex document.... Frontside is correct, backside is upsidedown....binded on short edge .... as well as I print the doc as PDF, ODF or any other app or fileformat

Dewellop avatar Jul 22 '24 20:07 Dewellop

OK, the cups-version 2.4.1 I took from [MFP4302_DS_LE_errlog.txt], but output of snap list --all is: cups 2.4.10-1 1058 latest/stable openprinting✓ - so it seems to be the latest version

The log you've shown uses CUPS 2.4.1, so it looks like you use the older version for printing.

All current updates of the system 22.04.4 LTS are implemented

It does not mean it has the latest versions available - LTS oriented systems usually froze most packages at certain version and don't follow the latest upstream releases.

cupsfilter --list-filters only leads to options list, like cups-filters --help

I mean this - https://launchpad.net/ubuntu/+source/cups-filters - if I understand the naming correctly - (it would be great if Ubuntu had the numbering together with names...) 2.0.0 is on 24.04.

Don't understand what you mean with scanning the printout of the duplex document.... Frontside is correct, backside is upsidedown....binded on short edge .... as well as I print the doc as PDF, ODF or any other app or fileformat

Ok, then it is clear - I don't see this with the latest versions, so unless it is due different printer model, it is fixed in the latest versions. Please cooperate with your OS support for further investigation.

If you find out the issue is even within the latest CUPS (currently 2.4.10) or cups-filters (2.0.0) releases, feel free to send logs and I'll reinvestigate.

zdohnal avatar Jul 23 '24 06:07 zdohnal