Solved Printing a PDF results in garbled output

I am trying to print a PDF and upon printing, I get garbled output. I cannot print in chrome, so instead, I'm printing in evince which does allow me to print to the printer, but produces the garbled output. Chrome is complaining the printer is not properly installed or configured and won't let me print to it. I haven't changed anything, nor do I see errors in the cups log file.
 
Is this with all pdfs or just one file? I usually print pdfs by using pdf2ps to convert into a ps file, then just send it to the printer with netcat,
Code:
 pdf2ps < myfile.pdf > myfile.ps 
nc <printer IP> 9100 <  myfile.ps
Actually if one just does pdf2ps <myfile.pdf> it will produce myfile.ps, you don't need the redirection.

This isn't answering your actual question, it's just offered as an alternative possibility.
 
Good catch, it is with that particular PDF. I printed another one just fine. I'm curious as to why that happens and if there is a way to fix it.
 
Good catch, it is with that particular PDF. I printed another one just fine. I'm curious as to why that happens and if there is a way to fix it.
I had that once, many years ago. Client reported a failed printer. It took a few days to identity that it was a specific PDF document causing the printer to freeze/lock up as a reset cleared it and it then worked fine until the user tried to print that specific file again. Eventually, I tracked down a report on the HP website acknowledging the fault and it being marked "will not fix". The workaround was to open the PDF in a different app and re-save it. I've forgotten the full details, but it was something quite rare and only when producing a PDF file from a particular PDF creator. No idea if it was the HP PDF renderer failing on some rare operation or simply not failing gracefully when it got bad code. A bit like UK air traffic control :)

So, try editing and saving the PDF file, or convert to something else and back again, ie pretty much anything that will change the file and hopefully produce a "correct" version
 
There are several pdf -> ps interpreters.
graphics/poppler https://poppler.freedesktop.org/ Command pdftops. Evince uses poppler.
print/ghostscript https://www.ghostscript.com/ Command pdf2ps

I have good results w/ graphics/zathura-pdf-mupdf (ghostscript based) but I do use lpr printing. It is keyboard driven and fast.
With the pdf open in zathura, command
Code:
:print
opens a print dialog.

There is an old 2013 Arch linux post that zathura-pdf-mupdf did not work well w/ cups and that graphics/zathura-pdf-poppler worked better. I suspect that ghostscript/mupdf may have improved rendering since 2013.
 
Last edited:
Back
Top