-
Notifications
You must be signed in to change notification settings - Fork 128
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
[driverless] HP Color LaserJet MFP M281 prints garbage instead of 'žčš' characters #331
Comments
You do not see any error in the log file as the filter got executed correctly and did its task correctly.
For raw printing, use the command
Please tell which of the files print correctly and which of them show the error. |
Original input file sent raw to the printer prints characters žčš fine, but the other issue appeared - some lines are bold (see). The classic driver (lsb/usr/HP/hp-color_laserjet_mfp_m278-m281-ps.ppd.gz) doesn't have any of those two issues. So the next action is to report it to evince, do you agree? |
Hi @surajkulriya , |
hey @zdohnal |
Note that evince does not pass through the input PDF file for printing it, but it renders the file as it does for screen display, only that it is redirected into GTK's PDF file generator and so a new PDF file gets generated. This is the significant impact. The filter chain, only consisting of the When using the classic driver the printer does not get a PDF file but raster graphics to print, the letters with accents are not generated by the printer any more but by Ghostscript on the host, meaning that Ghostscript is able to display the file correctly. Also evince is able to display the file correctly. Ghostscript and evince display even the print file, which evince had generated, correctly. So for me it looks like that the PDF interpreter in the printer has a bug and therefore some PDFs do not get printed correctly by this printer. As PostScript and PDF interpreters are rather complex they can easily have bugs, I get confronted with a lot of them when switching the standard printing format from PostScript to PDF, as suddenly GhostScript's PDF interpreter got massively exercised, as well as Poppler got exercised in a different way, and QPDF made it from a not that important hobby project to an integral part of the operating system and so bug reports came in here, too. As printer manufacturers implementing driverless printing want to attend as many users as possible, including the ones who print from an iPhone, they also include AirPrint and with this Apple Raster support, so IPP printers doing PDF usually also do Apple Raster, another of the 4 page description languages (PDLs) used by driverless printing. Apple Raster is a simple, well-defined raster graphics language, not much bug-prone when implemented in printer firmware. It also needs less of the limited memory and CPU resources of the printer. I have put the PDLs into a priority order, giving highest priority to PDF, as this is the most sophisticated PDL, expected to deliver best possible print quality. Switching the prioritarization to Apple Raster could imprrove printing reliabilty and also moves the complex step of PDF rendering to the host, where bugs can get fixed more easily (and we at OpenPrinting can fix them) and we have a lot more computational (memory and CPU) resources. Not that when using the original HPLIP driver, most probably raster data (in PCL format), in some cases also PostScript is sent to the printer. AFAIK HPLIP does not send PDF. Note that sending PostScript to a PostScript printer also easily causes similar bugs and it happened often already, cups-filters contains a lot of workarounds for such bugs (mainly in the pdftops filter). So sending raster graphics is usually the best bet. So I will try to flick the switch of priorities in cups-filters, so that if a printer supports both Apple Raster and PDF, to prefer the former. |
Please test and tell us whether this solves the problem. Thanks. |
This removes the |
@OdyX this answer was probably meant for Issue #235 and/or OpenPrinting/cups#65? |
Oh. Snap. Yes. That was a comment on aae86d2 , removing the symbol. What I'm saying is that it should never have been added, so (as it's unused) it's (as an exception) fine to remove now. |
Hi @tillkamppeter , unfortunately the preferring image/urf didn't help, the result is the same for the user. IIUC if urf is preferred, rastertopdf by default should be run, right? I started to experience the similar issue with diacritics with my printer and with a different PDF, I'll file a separate issue for that. |
@zdohnal, if we prefer URF on a driverless workflow, the incoming PDF is turned into PWG Raster via pdftoraster or gstoraster, the former using Poppler and the latter using Ghostscript. If with such a workflow the accents do not come out correctly, they either come already in broken (evince bug) or at least one of Ghostscript or Poppler is not able to render them. So we need to isolate. First the incoming PDF needs to get checked. Disable the print queue, send a job, and grab the Workaround is to force use of Poppler or Ghostscript when the other does wrong, by removing the execute bit from a filter and restarting CUPS. |
@zdohnal, did your user re-create his print queue after updating cups-filters? Did his PPD get generated by cups-filters ot by CUPS (I changed only cups-filters)? What I need from the user is his current PPD, his error_log (in debug mode), and his current |
First the data we have right now:
I will ask for the current d spool file and do the debugging filter by filter.
Is disabling the print queue needed or can it be substituted by 'PreserveJobFiles Yes'? I'm just making sure I don't mess up.
Do you have a way how to check the pdf without opening it in viewer (in this case and some others in the past the viewer shows the correct accentsm, but printed page looks different) or printing it out? |
@zdohnal, could you tell the user to do the following:
to
After savin the file, start CUOS again ( |
Aha, the conversion cost was too high - I got confused by zero in updated line in ppd, but forgot to count all other conversion costs before... gstoraster+rastertopwg are run atop of pdftopdf with this change. |
Just a side note - changing the conversion cost solved my own problem with a different PDF. Let's see if it helps the user too. Before that, I was able to workaround my own accent printing problem by regenerating the original PDF via ghostscript this way:
and then print it via Could this information help us in similar issues? Like this command would be called as a filter after going through pdftopdf, ghostscript will substitute any fonts it cannot find (especially some cairo fonts in PDFs generated by evince seems suspicious) and then go to other filters? This way we could stay with smaller PDF format being sent to the printer rather than big raster format. @tillkamppeter what do you think? Can it be helpful or was I just lucky it worked? |
The user was able to print accents with corrected conversion costs, but the first printing failed halfway with:
and about a half of page was printed. It really looks like printer bug. I asked for network traffic capture. The second printing attempt was good - the page was printed whole and with accents. |
Thanks, Till! I'll verify the commits by testing and then I'll close the bug. |
How it was tested:
The accents are ok and the job log shows |
The user now often experiences the mentioned error when printing image/urf - it looks M281 has a bug regarding URF processing. I removed the fix from Fedora for now, maybe we should revert the commit in cups-filters too? |
It seems that the user's printer is buggy on all driverless PDLs. |
@tillkamppeter what about staying with PDF and adding ghostscript call to regenerate pdf into |
Like this:
|
We should not modify The text rendering then happens on the computer, where one has needed fonts more easily or at least one can more easily add missing fonts. Creating a |
Then the code could be changed to:
Ad |
First, PCLm is a subset of PDF, every PDF display tool and every PDF printer should be able to display or print it. The special of PCLm is that it only contains embedded raster graphics, no vector graphics and not text, so it does not require fonts. It was created to allow driverless printing on cheaper printers, which do not have enough computational resources to render regular, full-fledged PDF. No explicit PCLm support is required on the printer side. So adding a As Ghostscript and pdftocairo render the PDF and create a new PDF there is a good probability to work around such font problems, probably they embedd fonts in the new PDF. They still pass on vector graphics with text, so they have still a higher incompatibility potential than raster-graphics-only PCLm. Also I had introduced the functionality to run Recently I converted all CUPS filters into filter functions in libcupsfilters, to make them more easily accessible for Printer Applications. Due to the fact that there were no complaints about QPDF-based form flattening I removed the Ghostscript/pdftocairo form-flattening support. So my idea now was to replace the standard PDF output for PDF printers by raster-only PDF and to get best working raster graphics for the printer, it should be in the printer's resolution, and when the printer has more than one resolution, in the resolution selected for the job. For this the rasterization needs to be done after |
Thank you for the info! Then it makes sense to try PCLm.
I agree.
I agree it is not ideal, but IMO it is a workaround which is usable till
Aha, I checked only the version 1.28.7., where gs and pdftocairo form flattening is still available.
Sounds good for the future. However, it would be good to have a workaround for now, since some devices don't understand URF correctly :( . |
Some printers print out garbled text if the job comes from evince and the original PDF contains a specific font. It is not certain whether cairo (PDF generator evince uses) has a bug in PDF rendering or cairo renders a correct PDF, but in PDF version which the printer doesn't support - but the switch to raster formats - image/urf or image/pwg-raster works around the issue. Related issues in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1904405 https://bugzilla.redhat.com/show_bug.cgi?id=1991678 The same workaround has been applied in cups-filters' PPD generator (OpenPrinting/cups-filters#331), proposing the possible final solution - using PCLm format.
Hi,
I have an report in Fedora for HP Color LaserJet MFP M281, which has a PPD generated via
driverless
driver.The user tried to print a file with diacritics (its file from /var/spool/cups here) but it resulted in garbage for 'čžš' characters when the job came out from the printer. We checked the file which comes out from filter chain , but the diacritics is correct there too.
I don't see any error in job log nor in IPP response.
We're going to try to print the file unfiltered since the printer accepts pdfs, but I'm not sure how to debug it further.
I guess the error will be connected to fonts, but I'm not sure how to prove it. Would you mind looking into it?
Thank you in advance!
Zdenek
The text was updated successfully, but these errors were encountered: