google / cloud-print-connector

Google Cloud Print Connector
BSD 3-Clause "New" or "Revised" License
765 stars 185 forks source link

Paper size always passed to CUPS as 'custom'. #279

Open ghost opened 8 years ago

ghost commented 8 years ago

Hello guys,

As discussed with Adam, I'm logging an issue for the paper size problem. Some information about the problem:

I've included the logging from the forum, the only clue I've seen so far in the CUPS logs (debug mode):

D [23/Jul/2016:10:49:29 +0000] [Job 51] Starting renderer with command: "foo2xqx-wrapper -r1200x600 -pCustom.595x842 -T3 -m1 -s7 -d1 -n1 " D [23/Jul/2016:10:49:29 +0000] [Job 51] Starting process "kid3" (generation 1) D [23/Jul/2016:10:49:29 +0000] [Job 51] Starting process "kid4" (generation 2) D [23/Jul/2016:10:49:29 +0000] [Job 51] Starting process "renderer" (generation 2) D [23/Jul/2016:10:49:29 +0000] [Job 51] JCL: %-12345X@PJL D [23/Jul/2016:10:49:29 +0000] [Job 51] D [23/Jul/2016:10:49:29 +0000] [Job 51] /usr/bin/foo2xqx-wrapper: 1: /usr/bin/foo2xqx-wrapper: dc: not found D [23/Jul/2016:10:49:29 +0000] [Job 51] /usr/bin/foo2xqx-wrapper: 1: /usr/bin/foo2xqx-wrapper: dc: not found D [23/Jul/2016:10:49:29 +0000] [Job 51] Illegal format 'x' for -g D [23/Jul/2016:10:49:29 +0000] [Job 51] renderer exited with status 0 D [23/Jul/2016:10:49:29 +0000] [Job 51] kid4 exited with status 0 D [23/Jul/2016:10:49:29 +0000] [Job 51] kid3 finished D [23/Jul/2016:10:49:29 +0000] [Job 51] Sent 0 bytes... D [23/Jul/2016:10:49:29 +0000] [Job 51] PID 950 (/usr/lib/cups/filter/foomatic-rip) did not catch or ignore signal 13. D [23/Jul/2016:10:49:29 +0000] PID 960 (unknown) exited with no errors. D [23/Jul/2016:10:49:29 +0000] [Job 51] Waiting for read thread to exit...

And with a working print out we see:

D [23/Jul/2016:10:47:17 +0000] [Job 50] Starting renderer with command: "foo2xqx-wrapper -r1200x600 -p9 -T3 -m1 -s7 -d1 -n1 " D [23/Jul/2016:10:47:17 +0000] [Job 50] Starting process "kid3" (generation 1) D [23/Jul/2016:10:47:17 +0000] [Job 50] Starting process "kid4" (generation 2) D [23/Jul/2016:10:47:17 +0000] [Job 50] Starting process "renderer" (generation 2) D [23/Jul/2016:10:47:17 +0000] [Job 50] JCL: %-12345X@PJL D [23/Jul/2016:10:47:17 +0000] [Job 50]

I'll post the full job log in a bit, my CUPS logs rolled over unfortunately, so I don't have the complete logging from the above jobs...

Let me know if you need more information.

Thanks!

HP-LaserJet_M1005_MFP.ppd.zip

ghost commented 8 years ago

Seems to be another issue as well... if I print from Chrome, I get the behavior above, but I can at least get a print out.... I tried printing from Gmail, and CUPS complains the data is not a valid PDF file and various other invalid formats:

D [27/Jul/2016:08:15:01 +0000] [Job 5] **** Warning: can't process font stream, loading font by the name.
D [27/Jul/2016:08:15:01 +0000] [Job 5] Page = 595x842; 11,11 to 584,831
D [27/Jul/2016:08:15:01 +0000] [Job 5] slow_collate=0, slow_duplex=0, slow_order=0
D [27/Jul/2016:08:15:01 +0000] [Job 5] This document does not conform to the Adobe Document Structuring Conventions and may not print correctly.
D [27/Jul/2016:08:15:01 +0000] [Job 5] **** Error reading a content stream. The page may be incomplete.
D [27/Jul/2016:08:15:01 +0000] [Job 5] **** File did not complete the page properly and may be damaged.

and

D [27/Jul/2016:08:15:02 +0000] [Job 5] **** This file had errors that were repaired or ignored.
D [27/Jul/2016:08:15:02 +0000] [Job 5] **** The file was produced by: 
D [27/Jul/2016:08:15:02 +0000] [Job 5] **** >>>> PDFium <<<<
D [27/Jul/2016:08:15:02 +0000] [Job 5] **** Please notify the author of the software that produced this
D [27/Jul/2016:08:15:02 +0000] [Job 5] **** file that it does not conform to Adobe's published PDF
D [27/Jul/2016:08:15:02 +0000] [Job 5] **** specification.

and

D [27/Jul/2016:08:15:03 +0000] [Job 5] Starting renderer with command: "foo2xqx-wrapper     -r1200x600 -pCustom.595x842 -T3 -m1 -s7   -d1 -n1 "
D [27/Jul/2016:08:15:03 +0000] [Job 5] Starting process "kid3" (generation 1)
D [27/Jul/2016:08:15:03 +0000] [Job 5] Starting process "kid4" (generation 2)
D [27/Jul/2016:08:15:03 +0000] [Job 5] Starting process "renderer" (generation 2)
D [27/Jul/2016:08:15:03 +0000] [Job 5] JCL: %-12345X@PJL
D [27/Jul/2016:08:15:03 +0000] [Job 5] <job data> 
**D [27/Jul/2016:08:15:03 +0000] [Job 5] GPL Ghostscript 9.16: Unrecoverable error, exit code 1
D [27/Jul/2016:08:15:03 +0000] [Job 5] Not a pbm file!**
D [27/Jul/2016:08:15:03 +0000] [Job 5] renderer exited with status 0
D [27/Jul/2016:08:15:03 +0000] [Job 5] Read 364 bytes of print data...
D [27/Jul/2016:08:15:03 +0000] [Job 5] Wrote 364 bytes of print data...
D [27/Jul/2016:08:15:03 +0000] [Job 5] kid4 exited with status 0
D [27/Jul/2016:08:15:03 +0000] [Job 5] kid3 finished
D [27/Jul/2016:08:15:03 +0000] [Job 5] Sent 364 bytes...
D [27/Jul/2016:08:15:03 +0000] [Job 5] PID 119 (/usr/lib/cups/filter/foomatic-rip) did not catch or ignore signal 13.
D [27/Jul/2016:08:15:03 +0000] [Job 5] Waiting for read thread to exit...
D [27/Jul/2016:08:15:03 +0000] [Job 5] Read 72 bytes of back-channel data...
D [27/Jul/2016:08:15:03 +0000] [Job 5] PID 120 (/usr/lib/cups/backend/usb) exited with no errors.
D [27/Jul/2016:08:15:03 +0000] [Job 5] time-at-completed=1469607303

I have the complete CUPS log in debug mode if it would help...

ghost commented 8 years ago

Check that... certain messages don't print while others do... it seems to be a content issue and not related to the Gmail app itself.

agoode commented 8 years ago

If you can extract a PDF that trips the file had errors that were repaired or ignored message, it would be great if you filed a bug at https://bugs.chromium.org/p/pdfium/issues/entry

agoode commented 8 years ago

Are all your print jobs coming from Android? There may be Android bugs that we'd need to work around.

595x842 is A4. My guess is that something is triggering a custom paper size. The ticket provided from the application specifies things in microns, so there may be some rounding/matching issue going on. (https://developers.google.com/cloud-print/docs/cdd#MediaSizeTicketItem)

Can you try printing from desktop Chrome to this printer? I'm not having any problems there, with various page sizes.

I have a Nexus 5X but can't try it right now.

This is exactly the kind of thing we need #166 for.

ghost commented 8 years ago

Yes all tests so far are coming from Android devices. Just tried it out on Chrome desktop and it works fine... made sure the job actually went through GCP, so it does indeed seem to be an Android related issue, or even simply a Cloud Print (the app) issue. I tried it on serveral devices, even an old Android 4.1.2 tablet, all with the same result.

ghost commented 8 years ago

About the PDF extract, do you mean simply print as PDF, or is this something I need to do on CUPS?

agoode commented 8 years ago

Ideally you'd dump the PDF before (or in the middle of) CUPS processing. CUPS will get a PDF from cloud-print-connector, then massage it through its filter pipeline. At some point, something goes wrong with the PDF. If the PDF is bad when it's handed to CUPS, then PDFium (or Android) is doing something odd. Otherwise, one of the CUPS filter stages might be at fault.

agoode commented 8 years ago

Also, thanks for this issue report!

ghost commented 8 years ago

FYI, I found original PDF print job file in /var/spool/cups but it seems to load fine when I open it up... looks like the problem is in CUPS filter chain. But that could also be due to the custom paper size problem... I'll have to dive into the CUPS documentation to see if you can configure CUPS to leave it's tmp files from the filter chain behind... that seems to get clean up on completion of the print job.

agoode commented 8 years ago

Also relevant for debugging is #175.

ghost commented 8 years ago

I forgot the actual problem in the issue for others... The printer complains about an odd paper size and doesn't print without manual interaction (pressing the OK button in the printer) and in some cases the job just doesn't print.

pmsrodrigues commented 5 years ago

This is still an issue with Google Chrome in Android. Any printer we share only gets CUSTOM for paper sizes available.