OpenPrinting / cups-filters

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
155 stars 125 forks source link

Some characters are not printed correctly #424

Closed YuGiOhJCJ closed 1 year ago

YuGiOhJCJ commented 3 years ago

Hello, I am on Slackware 14.2 (64-bit) and I am using:

I try to print a PDF file lp myfile.pdf but the result is a sheet with some characters replaced with a square symbol. The PDF file characters are shown correctly on xpdf and mupdf PDF viewers, the problem is just when I print with my printers (tested on two different printers).

I found a workaround. I am using:

Instead of using the lp myfile.pdf command I am using the xpdf myfile.pdf command then I click on File > Print... > Print. The result is perfect. However, I would like to use the lp command because I prefer this command line tool.

How can I get the same result as xpdf with the lp command please?

Thank you. Best regards.

Note: This issue was originally posted at the wrong place https://github.com/apple/cups/issues/5959

tillkamppeter commented 2 years ago

Could you please attach he PDF file(s) which you wanted to print to this bug report?

How did you set up your printer? Could you attach your printer's PPD file (in /etc/cups/ppd/, take a copy of it, rename it to have a .txt file name extension).

Could you provide the CUPS error_log (in debug mode) for us? Please run the command cupsctl --debug-logging in a terminal window, then print the file again, wait until the job comes out of your printer, and after that, copy your /var/log/cups/error_log file, rename the copy to have a .txt file name extension, and attach it to this bug report.

YuGiOhJCJ commented 2 years ago

Could you please attach he PDF file(s) which you wanted to print to this bug report?

Here is the PDF file: myfile.pdf

How did you set up your printer? Could you attach your printer's PPD file (in /etc/cups/ppd/, take a copy of it, rename it to have a .txt file name extension).

I used the web interface to set up my printer: http://localhost:631/ Here is the /etc/cups/ppd/lexmark-ms312dn.ppd file: lexmark-ms312dn.ppd.txt

Could you provide the CUPS error_log (in debug mode) for us? Please run the command cupsctl --debug-logging in a terminal window, then print the file again, wait until the job comes out of your printer, and after that, copy your /var/log/cups/error_log file, rename the copy to have a .txt file name extension, and attach it to this bug report.

I did:

$ sudo cupsctl --debug-logging
$ lp myfile.pdf 
request id is lexmark-ms312dn-48 (1 file(s))

Here is the /var/log/cups/error_log file: error_log.txt Here is the result: output.pdf As you can see there are some strange characters at the bottom of the page with some squares (above "Après avoir vérifié").

vermamohit13 commented 2 years ago

Hi @YuGiOhJCJ , Can you please run the command gs myfile.pdf on the terminal and attach the output displayed and the logs on the terminal?

Thanks

YuGiOhJCJ commented 2 years ago

Here is the output displayed: gs-myfile.pdf.pdf There are several pages in this output corresponding to each time I press the Return key.

vermamohit13 commented 2 years ago

Hi @YuGiOhJCJ ,

Thanks for the output. Kindly observe the strange characters.

The cupsfilter (pdftops) uses gs (Ghostscript) to convert PDF files to PS (postscript). However, the ghostscript is not able to find the CID Font "TimesNewRoman" because of which strange letters are being printed in the output, which you can observe in gs-myfile.pdf.pdf and ultimately results in strange characters being printed. So, the problem lies with Ghostscript, not with cupsfilters.

I have gone through some posts to solve your problem with ghostscript.Things you can try out:

  1. Try updating your ghostscript to the latest version and see if it works by using the command gs myfile.pdfand check for strange characters. (Ghostscript latest verion is 9.55).

  2. You can try solving this bug by following the thread - https://bugs.ghostscript.com/show_bug.cgi?id=691513

  3. If that doesn't work, you can search for other solutions available online (You can easily find out that many people are having this problem) or raise an issue at Ghostscript.

Thanks,

tillkamppeter commented 2 years ago

One remark: On Ubuntu 21.10 evince (Poppler-based) displays the PDF correctly, whereas Ghostscript 9.55.0 (the newest from upstream, not the one of the distro) shows the problem. I recommend reporting the problem to Ghostscript.

YuGiOhJCJ commented 1 year ago

I can confirm, the problem was Ghostscript. I upgraded from Ghostscript 9.19 to Ghostscript 9.56.1 and now all the characters are printed correctly. Also, when I run the command gs myfile.pdf the output is now correct. Problem fixed. Thanks.