Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ricoh MP-C4503 PDF/PS/PXL provided ppds do not work but Gutenprint PPD works #33

Closed
malsaqer opened this issue Jul 22, 2023 · 49 comments
Closed

Comments

@malsaqer
Copy link

Describe the bug
I have a Ricoh MP-C4503 copier and using the cups provided Gutenprint ppd file with no issue but it does not provide utilization of options like the attached finisher.

If I change the PPD file to the Ricoh provided ones located in openprinting then cups do send the job, and the printer shows a Job processing then cancelled with error like "The job was reset".

I tried by removing the printer and readd from scratch as well as just changing the driver from the working Gutenprint ppd file to the Ricoh provided file but get the same result.

To Reproduce
Steps to reproduce the behavior:

  1. Add the printer using any printer manager program.
  2. Follow instructions (either add a discovered network printer or add the printer's ip address directly)
  3. When choosing the driver, I choose the Ricoh PPD driver downloaded from openprinting.org
  4. Try to print a file or a click on "print test page"
  5. Cups show job completed
  6. Printer shows "the Job was resest"

Expected behavior
The printer prints.

System Information:

  • Fedora 38 64bit
  • Using any pdf viewer or print directly from command line
  • CUPS version: 2.4.6
@debiantriage
Copy link

I downloaded the referenced file from Openprinting into $HOME as ricoh.ppd. On Debian I executed

/usr/sbin/cupsfilter -p ricoh.ppd -m printer/foo -e /etc/nsswitch.conf > out.dat

brian@test-new:~$ file out.dat
out.dat: HP Printer Job Language data

The filtering system appears to have operated as expected to produce out.dat.

I would expect that a file sent to the queue C4503 set up with

lpadmin -p C4503 -v "URI" -E -P /home/brian/ricoh.ppd

would produce printing.

A URI can be obtained from lpinfo -v.

@malsaqer
Copy link
Author

Thank you for the answer. I followed the instructions. The printer showed in the cups server as expected. I tried printing a test page and got "The job was reset." error type shown in printer's error log.

The cupsfilter command screen output was:

[tigris: ~] sudo /usr/sbin/cupsfilter -p Downloads/Ricoh-MP_C4503_PDF.ppd -m printer/foo -e /etc/nsswitch.conf >out.dat
DEBUG: argv[0]="cupsfilter"
DEBUG: argv[1]="1"
DEBUG: argv[2]="root"
DEBUG: argv[3]="nsswitch.conf"
DEBUG: argv[4]="1"
DEBUG: argv[5]=""
DEBUG: argv[6]="/etc/nsswitch.conf"
DEBUG: envp[0]="CONTENT_TYPE=text/plain"
DEBUG: envp[1]="CUPS_DATADIR=/usr/share/cups"
DEBUG: envp[2]=""
DEBUG: envp[3]="CUPS_SERVERBIN=/usr/lib/cups"
DEBUG: envp[4]="CUPS_SERVERROOT=/etc/cups"
DEBUG: envp[5]="LANG=en_US.UTF8"
DEBUG: envp[6]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
DEBUG: envp[7]="PPD=Downloads/Ricoh-MP_C4503_PDF.ppd"
DEBUG: envp[8]="PRINTER_INFO=cupsfilter"
DEBUG: envp[9]="PRINTER_LOCATION=Unknown"
DEBUG: envp[10]="PRINTER=cupsfilter"
DEBUG: envp[11]="USER=root"
DEBUG: envp[12]="CHARSET=utf-8"
DEBUG: envp[13]="FINAL_CONTENT_TYPE=application/vnd.cups-pdf"
INFO: universal (PID 89326) started.
DEBUG: ppdFilterLoadPPD: Color profile qualifier determined from job and PPD data 'CMYK.Auto.600dpi'
DEBUG: ppdFilterLoadPPD: No ICC profiles specified in PPD
DEBUG: ppdFilterLoadPPD: Searching for profile "600dpi/Auto"...
DEBUG: ppdFilterLoadPPD: Last filter determined by the PPD: -; Final data MIME type: application/vnd.cups-pdf => PDF filter will log pages in page_log.
DEBUG: ppdFilterUniversal: "*cupsFilter(2): ..." lines in the PPD file:
DEBUG: ppdFilterUniversal: application/vnd.cups-raw application/octet-stream 0 -
DEBUG: ppdFilterUniversal: application/vnd.cups-pdf 0 -
DEBUG: ppdFilterUniversal: PPD uses "*cupsFilter: ..." lines, so we always convert to format given by FINAL_CONTENT_TYPE
DEBUG: ppdFilterUniversal: Converting from text/plain to application/vnd.cups-pdf
INFO: cfFilterChain: Running filter: universal
INFO: cfFilterChain: Running filter: pdftopdf+JCL
INFO: cfFilterChain: universal (PID 89327) started.
DEBUG: cfFilterUniversal: Converting from text/plain to application/pdf
DEBUG: cfFilterUniversal: Final output format for job: application/vnd.cups-pdf
DEBUG: cfFilterUniversal: Adding texttopdf to chain
INFO: cfFilterChain: Running filter: texttopdf
INFO: cfFilterChain: pdftopdf+JCL (PID 89328) started.
INFO: cfFilterChain: texttopdf (PID 89329) started.
DEBUG: Color space requested: Default
DEBUG: Final output format: CUPS Raster
INFO: ppdFilterEmitJCL: Filter function (PID 89330) started.
DEBUG: cfFilterPDFToPDF: Forced page logging selected by options.
DEBUG: cfFilterChain: texttopdf completed with status 0.
DEBUG: cfFilterPDFToPDF: Processing PDF input with QPDF: Page-ranges, page-set, number-up, booklet, size adjustment, ...
DEBUG: cfFilterPDFToPDF: "print-scaling" IPP attribute: auto
DEBUG: cfFilterPDFToPDF: Print scaling mode: Do not scale, center, crop if needed
DEBUG: cfFilterPDFToPDF: After Cropping: 612.000000 792.000000 612.000000 792.000000
PAGE: 1 1
INFO: cfFilterChain: texttopdf (PID 89329) exited with no errors.
DEBUG: cfFilterChain: universal completed with status 0.
INFO: cfFilterChain: universal (PID 89327) exited with no errors.
DEBUG: ppdFilterEmitJCL: Filter function (PID 89330) exited with no errors.
DEBUG: cfFilterChain: pdftopdf+JCL completed with status 0.
INFO: cfFilterChain: pdftopdf+JCL (PID 89328) exited with no errors.
INFO: universal (PID 89326) exited with no errors.

@debiantriage
Copy link

I have attached my out.dat as out.dat.txt. Remove .txt to use it.

Assuming the printer offers an open port 9100 (check with nmap IP_PRINTer_ADDRESS) I would expect out.dat to print t when sent directly there.

netcat IP_PRINTer_ADDRESS 9100 < out.dat

Two tests to do. Thanks.

[out.dat.txt](https://github.com/OpenPrinting/cups/files/12139732/out.dat.txt)

@malsaqer
Copy link
Author

Thank you again for that. My out.dat did not print but your's did. What PPD file from openprinting did you use?

@malsaqer
Copy link
Author

Here is the error output I get with the netcat command using my out.dat

[tigris: ~] netcat 192.168.1.247 9100 < out.dat
%%[ status: processing; source: %TCP/IP% ]%%
%%[ Error: undefined; OffendingCommand: obj ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%

@debiantriage
Copy link

debiantriage commented Jul 23, 2023

Thank you again for that. My out.dat did not print but your's did. What PPD file from openprinting did you use?

The one offered by PDF-Ricoh. Postscript-Ricoh requires foomatic-rip to be installed and I was reluctant to do that.

Please give what you get for

avahi-browse -rt _ipp._tcp

It would be enlightening.

@debiantriage
Copy link

Here is the error output I get with the netcat command using my out.dat

[tigris: ~] netcat 192.168.1.247 9100 < out.dat
%%[ status: processing; source: %TCP/IP% ]%%
%%[ Error: undefined; OffendingCommand: obj ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%

I am unable to take this further, It is a possible issue with PostScript processing or within the PDD. In either case CUPS doesn't appear to be the culprit.

@zdohnal
Copy link
Member

zdohnal commented Jul 24, 2023

Hi @malsaqer ,

thank you for reporting the issue!

Foomatic package offers driver for your printer, so you don't have to download it from web:

$ lpinfo -m | grep "Ricoh MP C4503"
gutenprint.5.3://ricoh-mp_c4503/expert Ricoh MP C4503 - CUPS+Gutenprint v5.3.4
gutenprint.5.3://ricoh-mp_c4503/simple Ricoh MP C4503 - CUPS+Gutenprint v5.3.4 Simplified
foomatic-db-ppds/Ricoh/PS/Ricoh-MP_C4503_JPN.ppd.gz Ricoh MP C4503 JPN
foomatic-db-ppds/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz Ricoh MP C4503 PDF
foomatic-db-ppds/Ricoh/PS/Ricoh-MP_C4503_PS.ppd.gz Ricoh MP C4503 PS
foomatic-db-ppds/Ricoh/PXL/Ricoh-MP_C4503_PXL.ppd.gz Ricoh MP C4503 PXL

Can you upload the out.data and PPD file here? If you do the following:

$ cp out.data{,.txt}

you can attach out.data.txt to this issue as a file.

Have the printer worked with previous Fedoras? In case you didn't use the older Fedora, here is the filter output from older Fedora -
ps_services_f37.txt - can you try sending the file over netcat as well and see if you get the result? It is one page from /etc/services.

The output from printer looks like postscript errors for me

I've checked briefly your printer specs too - it looks AirPrint is supported - https://support.apple.com/en-us/HT201311 - you once have opened IPP port on the printer and enabled mDNS (that's why Brian asks for avahi-browse output), you are able to print from common applications like Firefox, PDF Viewer or Libreoffice without any PPDs or installation.

You can verify whether the printer is seen by mDNS via the command @debiantriage shared, and IPP via ipptool. See https://docs.fedoraproject.org/en-US/quick-docs/cups-useful-tricks/#_how_to_find_out_whether_my_printer_is_capable_of_driverless_printing

@zdohnal
Copy link
Member

zdohnal commented Jul 24, 2023

@debiantriage thank you for the help! Fedora 38 is the first one with cups-filters 2.0, which is not in Debian yet, so there might be a regression...

Here is the error output I get with the netcat command using my out.dat

[tigris: ~] netcat 192.168.1.247 9100 < out.dat
%%[ status: processing; source: %TCP/IP% ]%%
%%[ Error: undefined; OffendingCommand: obj ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%

I am unable to take this further, It is a possible issue with PostScript processing or within the PDD. In either case CUPS doesn't appear to be the culprit.

The PPD @malsaqer uses creates PDF, and postscript interpreter looks to be listening on port 9100 - the error message gives me ghostscript vibes...

@malsaqer does your printer have some enable options for file formats it accepts? The errors netcat showed gives me feeling the printer expects postscript, but PDF is sent (correctly, the PPD tells filters to create PDF).

Can you use cupsfilter command with PS PPD, get new out.data and send it via netcat and see what it returns?

@malsaqer
Copy link
Author

Hi @malsaqer ,

thank you for reporting the issue!

Have the printer worked with previous Fedoras? In case you didn't use the older Fedora, here is the filter output from older Fedora - ps_services_f37.txt - can you try sending the file over netcat as well and see if you get the result? It is one page from /etc/services.

It printed but random characters (all printable though) with a couple font messages (replacing Nimbus with courier)

@malsaqer
Copy link
Author

malsaqer commented Jul 25, 2023

OK. Using the PDF ppd (with the cupsfilter command, and replacing the "-m printer/foo" with "-m Application/pdf" through the netcat command, the printing went through smoothly with no error.

cupsfilter -p /usr/share/foomatic/db/source/PPD/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz -m application/pdf -e Downloads/470-5356.pdf >out-pdf.dat
netcat 192.168.1.247 9100 < out-pdf.dat

produced a clean color print.

I am not sure how to enforce these options for my regular printings!

@zdohnal
Copy link
Member

zdohnal commented Jul 25, 2023

It printed but random characters (all printable though) with a couple font messages (replacing Nimbus with courier)

So you didn't use the printer with Fedora 37 I reckon.

OK. Using the PDF ppd (with the cupsfilter command, and replacing the "-m printer/foo" with "-m Application/pdf" through the netcat command, the printing went through smoothly with no error.

cupsfilter -p /usr/share/foomatic/db/source/PPD/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz -m application/pdf -e Downloads/470-5356.pdf >out-pdf.dat
netcat 192.168.1.247 9100 < out-pdf.dat

produced a clean color print.

Interesting - if you create a printer this way:

$ lpadmin -p printer -v socket://192.168.1.247 -m foomatic-db-ppds/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz -E

does it work? If it does not, my suspicion is the cause of this is the line in PPD file which causes file format change:

*cupsFilter: "application/vnd.cups-pdf 0 -"

your check with cupsfilter says the printer works with application/pdf, so if we change this line in PPD file, it could do the trick.

You can make changes in PPD this way:

$ sudo cp /etc/cups/ppd/printer.ppd ~/printer.ppd
# change the line in the copied file
*cupsFilter: "application/vnd.cups-pdf 0 -" 
to
*cupsFilter: "application/pdf 0 -"
$ sudo lpadmin -p printer -v socket://192.168.1.247:9100 -P ~/printer.ppd -E

@debiantriage
Copy link

It seems to me that the nub of the issue is that @malsaqer wishes to make use of the device's finishing capabilities. For whatever reason foomatic-rip and Postscript-Ricoh do not appear to be co-operating with each other. However, PDF-Ricoh has the same finishing options and is known to produce suitable printed output. This PPD looks like a viable candidate to set up a print queue.

Having avahi-browse -rt _ipp._tcp may very well give a second technique to use the finishing capabilities of the printer.

@malsaqer
Copy link
Author

Having avahi-browse -rt _ipp._tcp may very well give a second technique to use the finishing capabilities of the printer.

This command returns nothing. I have these packages installed: avahi avahi-dnsconfd avahi-glib avahi-gobject avahi-libs avahi-tools netresolve-backends-avahi

@malsaqer
Copy link
Author

It printed but random characters (all printable though) with a couple font messages (replacing Nimbus with courier)

So you didn't use the printer with Fedora 37 I reckon.
I did but always worked with the gutenprint driver.

OK. Using the PDF ppd (with the cupsfilter command, and replacing the "-m printer/foo" with "-m Application/pdf" through the netcat command, the printing went through smoothly with no error.

cupsfilter -p /usr/share/foomatic/db/source/PPD/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz -m application/pdf -e Downloads/470-5356.pdf >out-pdf.dat
netcat 192.168.1.247 9100 < out-pdf.dat

produced a clean color print.

Interesting - if you create a printer this way:

$ lpadmin -p printer -v socket://192.168.1.247 -m foomatic-db-ppds/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz -E

does it work?

No. Same problem reproduced.

If it does not, my suspicion is the cause of this is the line in PPD file which causes file format change:

*cupsFilter: "application/vnd.cups-pdf 0 -"

your check with cupsfilter says the printer works with application/pdf, so if we change this line in PPD file, it could do the trick.

You can make changes in PPD this way:

$ sudo cp /etc/cups/ppd/printer.ppd ~/printer.ppd
# change the line in the copied file
*cupsFilter: "application/vnd.cups-pdf 0 -" 
to
*cupsFilter: "application/pdf 0 -"
$ sudo lpadmin -p printer -v socket://192.168.1.247:9100 -P ~/printer.ppd -E

I do not think the problem with PPD file but with the cups filter forcing the "application/vnd.cups-postscript" as a final content type if we use "-m printer/foo" option. If I omit the "-m printer/foo" altogether, the printer works and the final content type is the default one: "application/pdf" which seems to be the culprit.

I think the "printer/foo" option misbehaves and forces "application/vnd.cups-postscript" even after I made the change in the ppd file from [*cupsFilter: "application/vnd.cups-pdf 0 -"] to [*cupsFilter: "application/pdf 0 -"]

@zdohnal
Copy link
Member

zdohnal commented Jul 26, 2023

Having avahi-browse -rt _ipp._tcp may very well give a second technique to use the finishing capabilities of the printer.

This command returns nothing. I have these packages installed: avahi avahi-dnsconfd avahi-glib avahi-gobject avahi-libs avahi-tools netresolve-backends-avahi

@malsaqer does avahi-browse -avrt make any difference? Check your printer settings in your printer's web ui - you have probably disable mDNS/Bonjour or Airprint options.

@malsaqer please upload enable debug logging for CUPS by:

$ cupsctl LogLevel=debug2

reproduce the issue and attach here log file log.txt from this command:

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

(if log.txt is too large, delete older lines before your job started).

Additionally, please upload your PPD as well - your initial report mentions three drivers and two are being discussed, so I'm confused which one is really in work :) .

I think the "printer/foo" option misbehaves and forces "application/vnd.cups-postscript" even after I made the change in
the ppd file from [*cupsFilter: "application/vnd.cups-pdf 0 -"] to [*cupsFilter: "application/pdf 0 -"]

Just to be sure, have you reinstalled the printer with the new PPD file? It is required for cupsd to recognize the change.

@malsaqer
Copy link
Author

malsaqer commented Jul 27, 2023

@malsaqer does avahi-browse -avrt make any difference? Check your printer settings in your printer's web ui - you have probably disable mDNS/Bonjour or Airprint options.

Bonjour and dirprint are enabled (with other things like ipp). No mdns nor airprint is available.

[tigris: ~] avahi-browse -avrt Server version: avahi 0.8; Host name: tigris.local
E Ifce Prot Name Type Domain + wlp78s0 IPv4 RICOH MP C4503 [002673740C7E] _http._tcp local
= wlp78s0 IPv4 RICOH MP C4503 [002673740C7E] _http._tcp local hostname = [Richo.local]
address = [192.168.1.247] port = [80]
txt = ["path=/"]: Cache exhausted
: All for now

@malsaqer
Copy link
Author

malsaqer commented Jul 27, 2023

Additionally, please upload your PPD as well - your initial report mentions three drivers and two are being discussed, so I'm confused which one is really in work :) .

The ppds I used are the ones in foomatic data base.

All three did not work. If I use the PDF ppd, the error in the printer "The job was reset". If I use the "PS" ppd the error at the printer "print data error". In both cases, the file is sent to the printer and the data receiving led blinks.

PXL driver had same problem. Now I tried it again and it worked (surprisingly) but without color!!! The color issue might be a different animal because even the gutenprint has also lost color printing and not sure how and why.

Here is the log it includes the last failed print using the PS ppd file.

log.txt

@malsaqer
Copy link
Author

malsaqer commented Jul 27, 2023

It might be also useful to show you the error buffer when I created printouts using cupsfiter with and without the printer/foo option.

The commads are:
1- using -m printer/foo and printing out-ps-printerfoo.dat does not work using the netcat
` cupsfilter -p Ricoh-MP_C4503_PS.ppd -m printer/foo Downloads/470-5356.pdf > out-ps-printerfoo.dat 2>out-ps-printerfoo.err.txt
out-ps-printerfoo.err.txt

2- ommiting the -m printer/foo (or using -m application/pdf) and printing out-ps.dat works using the netcat
` cupsfilter -p Ricoh-MP_C4503_PS.ppd Downloads/470-5356.pdf > out-ps.dat 2>out-ps.err.txt
out-ps.err.txt

@zdohnal
Copy link
Member

zdohnal commented Jul 27, 2023

@malsaqer does avahi-browse -avrt make any difference? Check your printer settings in your printer's web ui - you have probably disable mDNS/Bonjour or Airprint options.

Bonjour and dirprint are enabled (with other things like ipp). No mdns nor airprint is available.

[tigris: ~] avahi-browse -avrt Server version: avahi 0.8; Host name: tigris.local
E Ifce Prot Name Type Domain + wlp78s0 IPv4 RICOH MP C4503 [002673740C7E] _http._tcp local
= wlp78s0 IPv4 RICOH MP C4503 [002673740C7E] _http._tcp local hostname = [Richo.local]
address = [192.168.1.247] port = [80]
txt = ["path=/"]: Cache exhausted
: All for now

Really strange - Only web interface is advertised, but not IPP service. I recommend checking the printer's network settings and experiment - there should be _ipp._tcp in mDNS search at least, if the IPP is enabled.

Is IPP port opened at least?

$ sudo dnf -y install nmap-ncat
$ nc -vz 192.168.1.247 631

This should pass if IPP port is opened. If it is not, check the printer settings once more (if IPP port is not working, it would explain missing IPP service advertisement). Successful test should end with something like Ncat: 0 bytes sent, 0 bytes received in 1.68 seconds..

@zdohnal
Copy link
Member

zdohnal commented Jul 27, 2023

The ppds I used are the ones in foomatic data base.

All three did not work.

Please focus on one at the time. It is difficult to keep track the issue other way. Let's start with PDF.

Here is the log it includes the last failed print using the PS ppd file.

Please upload the one with PDF printer. Additionally please stop and start cupsd as well - your log shows you've hit OpenPrinting/cups#604 and your systemd rate limit was low, so many lines were hidden under:

Jul 26 23:34:38 tigris.localdomain systemd-journald[809]: Suppressed 122006 messages from cups.service

@zdohnal
Copy link
Member

zdohnal commented Jul 27, 2023

The commads are: 1- using -m printer/foo and printing out-ps-printerfoo.dat does not work using the netcat ` cupsfilter -p Ricoh-MP_C4503_PS.ppd -m printer/foo Downloads/470-5356.pdf > out-ps-printerfoo.dat 2>out-ps-printerfoo.err.txt out-ps-printerfoo.err.txt

2- ommiting the -m printer/foo (or using -m application/pdf) and printing out-ps.dat works using the netcat ` cupsfilter -p Ricoh-MP_C4503_PS.ppd Downloads/470-5356.pdf > out-ps.dat 2>out-ps.err.txt out-ps.err.txt

Is Ricoh-MP_C4503_PS.ppd really PS driver? The log shows it has pdf filter in it:

DEBUG: ppdFilterUniversal: "*cupsFilter(2): ..." lines in the PPD file:
DEBUG: ppdFilterUniversal:    application/vnd.cups-raw application/octet-stream 0 -
DEBUG: ppdFilterUniversal:    application/vnd.cups-pdf 0 foomatic-rip

or did you upload a wrong log?

Either way, the second command works because you use PDF file - if you don't define output type with -m, it takes file format of infile.
Additionally, parameter -e has to be used if you use PPD just to be sure, because cupsfilter uses Postscript output format (because it is default purpose of PPD - define way how to convert to Postscript and provide options - but some vendors uses it for other formats too, like in this case).

@debiantriage
Copy link

Really strange - Only web interface is advertised, but not IPP service. I recommend checking the printer's network settings and experiment - there should be _ipp._tcp in mDNS search at least, if the IPP is enabled.

Is IPP port opened at least?

AirPrint advice for the C4503 is given in this PDF.

@malsaqer
Copy link
Author

Is IPP port opened at least?

$ sudo dnf -y install nmap-ncat
$ nc -vz 192.168.1.247 631

This should pass if IPP port is opened. If it is not, check the printer settings once more (if IPP port is not working, it would explain missing IPP service advertisement). Successful test should end with something like Ncat: 0 bytes sent, 0 bytes received in 1.68 seconds..

Here is the result:

$ nc -vz 192.168.1.247 631
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.1.247:631.
Ncat: 0 bytes sent, 0 bytes received in 0.02 seconds.

@malsaqer
Copy link
Author

malsaqer commented Jul 28, 2023

Please focus on one at the time. It is difficult to keep track the issue other way. Let's start with PDF.

OK. I did two cupsfilter command using the pdf driver. The first with the -m printer/foo and the second without the -m option (cupsfilter man page says it will use the default application/pdf). I forwarded the standard error output to .err.txt files and I captured the cupslog lines at the times when these two cupsfilter commands where issued.

out-pdf-printerfoo.err.txt <-- netcat not working with output of this command.
out-pdf.err.txt <-- netcat works.
cupslog.txt

@malsaqer
Copy link
Author

malsaqer commented Jul 28, 2023

Is Ricoh-MP_C4503_PS.ppd really PS driver? The log shows it has pdf filter in it:

DEBUG: ppdFilterUniversal: "*cupsFilter(2): ..." lines in the PPD file:
DEBUG: ppdFilterUniversal:    application/vnd.cups-raw application/octet-stream 0 -
DEBUG: ppdFilterUniversal:    application/vnd.cups-pdf 0 foomatic-rip

or did you upload a wrong log?

I think so. Disregard this log because the ppd its was edited by me in this one.

Either way, the second command works because you use PDF file - if you don't define output type with -m, it takes file format of infile.

You are right. The infile is a pdf file. If I use a txt file instead, I get error where it worked (as shown in the above reply). I can upload the relevant info if you think it is needed.

@zdohnal
Copy link
Member

zdohnal commented Jul 28, 2023

Really strange - Only web interface is advertised, but not IPP service. I recommend checking the printer's network settings and experiment - there should be _ipp._tcp in mDNS search at least, if the IPP is enabled.
Is IPP port opened at least?

AirPrint advice for the C4503 is given in this PDF.

Thanks, Brian! @malsaqer is it everything set according to the manual?

@zdohnal
Copy link
Member

zdohnal commented Jul 28, 2023

$ nc -vz 192.168.1.247 631
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.1.247:631.
Ncat: 0 bytes sent, 0 bytes received in 0.02 seconds.

Ok, so please try:

$ ipptool -tv ipp://192.168.1.247/ipp/print get-printer-attributes.test

The command sends a IPP request to the printer and if the response is okay, you will see [PASS] among output lines. This means the printer should be able to work with IPP Everywhere, so if it passes, try:

$ lpadmin -p printer -v  ipp://192.168.1.247/ipp/print -m everywhere -E && sleep 5

(sleep is there because it takes a moment to create PPD file in successful attempt)

If everything is okay, you can use your printer with this queue.

@zdohnal zdohnal changed the title Ricoh PDF/PS/PXL provided ppds do not work but Gutenprint PPD works Ricoh MP-C4503 PDF/PS/PXL provided ppds do not work but Gutenprint PPD works Jul 28, 2023
@zdohnal
Copy link
Member

zdohnal commented Jul 28, 2023

Please focus on one at the time. It is difficult to keep track the issue other way. Let's start with PDF.

OK. I did two cupsfilter command using the pdf driver. The first with the -m printer/foo and the second without the -m option (cupsfilter man page says it will use the default application/pdf). I forwarded the standard error output to .err.txt files and I captured the cupslog lines at the times when these two cupsfilter commands where issued.

out-pdf-printerfoo.err.txt <-- netcat not working with output of this command. out-pdf.err.txt <-- netcat works. cupslog.txt

Looking into the logs again and applying the knowledge that changing application/vnd.cups-pdf -> application/pdf did not help, I've recalled this issue OpenPrinting/cups#510 - in that case it was an issue of one file type not being able to cope with PJL, so it might be possible certain models can turn off PJL support or have it buggy.

The proof for this are the netcat responses to those two files created by cupsfilter - the PDF which is encapsulated in PJL commands (the one driver - -m printer/foo - produces) is not accepted, although the simple PDF from the other cupsfilter is printed. The driver itself shows the printer has PJL and PDF support (CMD part of the line):

*1284DeviceID: "MFG:RICOH;MDL:MP C4503;CMD:PDF,PJL;"

@malsaqer Can you check in the printer's web ui whether there are options which could turn on/enable JCL/PJL support?

@michaelrsweet do you know how can I debug and check whether the PDF with PJL commands is okay? I've checked it with PDF viewer and it looked ok...

@malsaqer
Copy link
Author

@malsaqer Can you check in the printer's web ui whether there are options which could turn on/enable JCL/PJL support?

Under "Permissions for Printer Language to Operate File System", both PDF and PJL "File System Operation" are set to "Permit"

@malsaqer
Copy link
Author

Ok, so please try:

$ ipptool -tv ipp://192.168.1.247/ipp/print get-printer-attributes.test

The command sends a IPP request to the printer and if the response is okay, you will see [PASS] among output lines. This means the printer should be able to work with IPP Everywhere

[tigris: ~] ipptool -tv ipp://192.168.1.247/ipp/print get-printer-attributes.test
"/usr/share/cups/ipptool/get-printer-attributes.test":
    Get-Printer-Attributes:
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        printer-uri (uri) = ipp://192.168.1.247:631/ipp/print
        requested-attributes (1setOf keyword) = all,media-col-database
    Get printer attributes using get-printer-attributes                  [FAIL]
        RECEIVED: 128 bytes in response
        status-code = server-error-version-not-supported (server-error-version-not-supported)
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en-us
        status-message (textWithoutLanguage) = server-error-version-not-supported
        Bad version 1.1 in response - expected 2.0 (RFC 8011 section 4.1.8).
        EXPECTED: STATUS successful-ok (got server-error-version-not-supported)
        status-message="server-error-version-not-supported"
        EXPECTED: charset-configured
        EXPECTED: charset-supported
        EXPECTED: compression-supported
        EXPECTED: document-format-default
        EXPECTED: document-format-supported
        EXPECTED: generated-natural-language-supported
        EXPECTED: ipp-versions-supported
        EXPECTED: media-col-default
        EXPECTED: natural-language-configured
        EXPECTED: operations-supported
        EXPECTED: printer-info
        EXPECTED: printer-is-accepting-jobs
        EXPECTED: printer-location
        EXPECTED: printer-make-and-model
        EXPECTED: printer-more-info
        EXPECTED: printer-name
        EXPECTED: printer-state
        EXPECTED: printer-state-reasons
        EXPECTED: printer-up-time
        EXPECTED: printer-uri-supported
        EXPECTED: uri-authentication-supported
        EXPECTED: uri-security-supported

@malsaqer
Copy link
Author

Really strange - Only web interface is advertised, but not IPP service. I recommend checking the printer's network settings and experiment - there should be _ipp._tcp in mDNS search at least, if the IPP is enabled.
Is IPP port opened at least?

AirPrint advice for the C4503 is given in this PDF.

Thanks, Brian! @malsaqer is it everything set according to the manual?

Yes I checked every thing. For the record, the printer used to show up in network printer. It just stopped doing so and I do not recall what exactly triggered it.

@zdohnal
Copy link
Member

zdohnal commented Jul 31, 2023

[tigris: ~] ipptool -tv ipp://192.168.1.247/ipp/print get-printer-attributes.test
status-code = server-error-version-not-supported (server-error-version-not-supported)
...
Bad version 1.1 in response - expected 2.0 (RFC 8011 section 4.1.8).
EXPECTED: STATUS successful-ok (got server-error-version-not-supported)
status-message="server-error-version-not-supported"

Does the printer have some settings regarding IPP version? The test complains about the printer answering with IPP 1.1 instead of 2.0 which is required for driverless printing.

If it doesn't, please report this to Ricoh (maybe here? https://www.ricoh-europe.com/support/product-support/support-enquiry/ ) - because the printer is reported as supporting Airprint - https://support.apple.com/en-us/HT201311 - but does not use IPP 2.0 or later as protocol.

@zdohnal
Copy link
Member

zdohnal commented Jul 31, 2023

Ad PDF driver - I've checked changes between outputs of older and current filters - I see there is following:

New:
@PJL ENTER LANGUAGE = PDF<0A>%PDF-1.3

Old:
@PJL ENTER LANGUAGE = PDF
%PDF-1.3

Let's try whether this is the reason why PDF driver is broken now.

Download the testing rpm and reproduce the issue:

$ sudo dnf -y install https://kojipkgs.fedoraproject.org//work/tasks/970/104180970/libppd-2.0~rc2-1.fc38.test.1.x86_64.rpm
$  cupsfilter -p PDF.ppd -e -m printer/foo Downloads/470-5356.pdf > out-pdf-printerfoo.dat
$ netcat 192.168.1.247 9100 < out-pdf-printerfoo.dat

Do let me know about result - if it does not work, give me output of netcat if it produces warnings/errors. PDF.ppd is Ricoh PDF ppd, printer/foo is your printer installed in CUPS.

@malsaqer
Copy link
Author

Do let me know about result - if it does not work, give me output of netcat if it produces warnings/errors. PDF.ppd is Ricoh PDF ppd, printer/foo is your printer installed in CUPS.

I used the PPD included in the package: /usr/share/ppd/cupsfilters/Ricoh-PDF_Printer-PDF.ppd and it worked.

@zdohnal
Copy link
Member

zdohnal commented Aug 1, 2023

@malsaqer Good to know, but please use PDF ppd from foomatic (which is the PDF Ricoh from OpenPrinting web page), which you reported as broken.

@michaelrsweet
Copy link
Member

@zdohnal

do you know how can I debug and check whether the PDF with PJL commands is okay? I've checked it with PDF viewer and it looked ok...

I'm not aware of any tools for this -historically I've just looked at the raw print data and confirmed that the expected PJL commands are there...

@zdohnal
Copy link
Member

zdohnal commented Aug 3, 2023

@malsaqer any update?

If it works with PDF PPD which was used at the beginning of this issue, I would like to move to PS driver, if you have time.

@tillkamppeter
Copy link
Member

It might be also useful to show you the error buffer when I created printouts using cupsfiter with and without the printer/foo option.

The commads are: 1- using -m printer/foo and printing out-ps-printerfoo.dat does not work using the netcat ` cupsfilter -p Ricoh-MP_C4503_PS.ppd -m printer/foo Downloads/470-5356.pdf > out-ps-printerfoo.dat 2>out-ps-printerfoo.err.txt out-ps-printerfoo.err.txt

2- ommiting the -m printer/foo (or using -m application/pdf) and printing out-ps.dat works using the netcat ` cupsfilter -p Ricoh-MP_C4503_PS.ppd Downloads/470-5356.pdf > out-ps.dat 2>out-ps.err.txt out-ps.err.txt

@malsaqer could you attach the files out-ps-printerfoo.dat and out-ps.dat from these two commands?

Note that the fix of OpenPrinting/libppd#24 is not applicable to the PS and PXL cases.

@malsaqer
Copy link
Author

malsaqer commented Aug 5, 2023

@malsaqer Good to know, but please use PDF ppd from foomatic (which is the PDF Ricoh from OpenPrinting web page), which you reported as broken.

Sorry for the delay but I've been occupied lately. I confirm it worked also. I used the ppd file /usr/share/foomatic/db/source/PPD/Ricoh/PDF/Ricoh-MP_C4503_PDF.ppd.gz and netcat printed the pdf OK.

I wanted to see if I can print using the GUI. I added a printer using the system-config-printer. I chose the PDF driver from foomatic and it printed a test page successfully. I also chose the PXL driver and worked also but the PS driver did not print.

best;

@zdohnal
Copy link
Member

zdohnal commented Aug 7, 2023

@malsaqer thank you for confirmation!

Can you get us output files for PS driver and its logs when you do cupsfilter command as Till asked above?

@malsaqer
Copy link
Author

malsaqer commented Aug 7, 2023

Can you get us output files for PS driver and its logs when you do cupsfilter command as Till asked above?

@zdohnal Sure.

cupsfilter -p /usr/share/foomatic/db/source/PPD/Ricoh/PS/Ricoh-MP_C4503_PS.ppd.gz -e -m printer/foo twoPages.pdf > out-PS-printerfoo.dat 2>out-PS-printerfoo.stderr.txt
mv out-PS-printerfoo.dat{,.txt}

out-PS-printerfoo.dat.txt

out-PS-printerfoo.stderr.txt

@zdohnal
Copy link
Member

zdohnal commented Aug 9, 2023

@malsaqer does printer foo exist on your machine? It should be an actual printer installed with the PS driver you use.

FTR, cupsfilter produces postscript only if we omit -e - can you try omitting it and send the result to the printer? It would tell us whether the issue is in foomatic-rip (the filter the PPD tells us to use) or in the earlier filters.

Please upload the log and the output file here as well.

Thank you in advance!

@malsaqer
Copy link
Author

I tried without the -e option, and netcat did not print. here are the outputs
out-PS-printerfoo-noe.dat.txt
out-PS-printerfoo-noe.stderr.txt

@malsaqer
Copy link
Author

malsaqer commented Aug 20, 2023

Just wanted to let you know that I have no access to this printer anymore. Further testings won't be possible unless our replacement be of the same model number.

I thank everyone who was helping and providing support to get this printer working.

@zdohnal
Copy link
Member

zdohnal commented Aug 23, 2023

Thanks for letting us know! I'll pass the issue to libcupsfilters for further debugging (output postscript file is generated in the library) for future tracking.

@tillkamppeter do you have enough data to find out a fix or should we close this since there is no way to verify the possible fix right now?

@zdohnal zdohnal transferred this issue from OpenPrinting/cups Aug 23, 2023
@tillkamppeter
Copy link
Member

For me all the generated PostScript files look OK and they display correctly with evince (which uses Ghostscript). So I am not able to locate any bug. Looks like the PPD provided by Ricoh perhaps supplies some incompatible or broken PostScript code with one of the options. As @malsaqer does not have the printer any more and will not necessarily get the same model as replacement I will close this bug here, and generally, if a printer supports other formats than PostScript, recommend using one of the other formats, as printer's PostScript interpreters are often buggy. Especially we see here that the printer in question works as a PDF or PXL printer.

@malsaqer
Copy link
Author

For me all the generated PostScript files look OK and they display correctly with evince (which uses Ghostscript). So I am not able to locate any bug. Looks like the PPD provided by Ricoh perhaps supplies some incompatible or broken PostScript code with one of the options. As @malsaqer does not have the printer any more and will not necessarily get the same model as replacement I will close this bug here, and generally, if a printer supports other formats than PostScript, recommend using one of the other formats, as printer's PostScript interpreters are often buggy. Especially we see here that the printer in question works as a PDF or PXL printer.

We replaced the printer with ricoh MP-C3504 which works just fine using either PS or PDF providing PPD drivers! Thank you for providing help with the previous printer with a fix that made it work until replaced.

@tillkamppeter
Copy link
Member

Thanks for the update, @malsaqer !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants