cups-pdf troubles

If none of the more specific forums is the right place to ask

cups-pdf troubles

Postby zapstrap » 2018-03-06 01:12

Hi all,

I have an older installation of Debian, 3.16.7-ckt11-1, running on an i3-2100 @ 3.10GHz w. 8GB RAM, and am running cups v1.7.5. The machine is headless, and is basically a network server/firewall machine. One of its purposes is to provide a pdf converter a la cups. I print from Windows machines using samba quite a lot. I am having a very obscure problem with this driver. It does not seem to be rendering fonts properly. Documents sent to the printer are readable, but if I highlight and copy text out of the document, when I paste it elsewhere, it's not unrecognizable. For instance:

If I take this line of text:
Code: Select all
Power Supply Requirements

I get this:
Code: Select all




... which translates to something like <ctrl>O\n<ctrl>P\n<ctrl>C\n, and I realise what's rendered above looks like a blank window. I can sort of live with this problem, but would rather solve it.

There's a larger problem, however: many of the postscript files I send to this device contain encapsulated postscript files, and most but not all of them are getting converted to bitmaps. There does not seem to be a rhyme or reason to it.

I tried copying the postscript file from /var/spool/cups and converting it to a pdf using a command-line call to ghostscript (v9.06), and that produces the exact output I want. I even went to the trouble of using the exact ghostscript call from /etc/cups/cups-pdf.conf. All fonts are rendered properly, and no bitmaps. I am now at the point of printing my jobs from their respective applications by printing to a postscript file and running a bash script -if linux, batch if windows- on them. This seems like a giant step backwards, as before I had to tangle with cups I just used an lpd printer with ghostscript connected to it, et voila; beautifully rendered output with embedded fonts, smooth graphics, nice colours... it was great.

If I go into cups-pdf.conf and set the log level to 4, when I send a job from a word processor, I get something like this:

Code: Select all
Mon Mar  5 16:35:32 2018  [DEBUG] user identified (elvis)
Mon Mar  5 16:35:32 2018  [DEBUG] output directory name generated (/home/elvis/pdf)
Mon Mar  5 16:35:32 2018  [DEBUG] user information prepared
Mon Mar  5 16:35:32 2018  [DEBUG] spoolfile name created (/var/spool/cups-pdf/SPOOL/cups2pdf-994)
Mon Mar  5 16:35:32 2018  [DEBUG] source stream ready
Mon Mar  5 16:35:32 2018  [DEBUG] destination stream ready (/var/spool/cups-pdf/SPOOL/cups2pdf-994)
Mon Mar  5 16:35:32 2018  [DEBUG] owner set for spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-994)
Mon Mar  5 16:35:32 2018  [DEBUG] using traditional fgets
Mon Mar  5 16:35:35 2018  [DEBUG] found beginning of postscript code (%!PS-Adobe-3.0)
Mon Mar  5 16:35:35 2018  [DEBUG] now extracting postscript code
Mon Mar  5 16:35:35 2018  [DEBUG] found title in ps code ((smbprn.00003231 my_document)
r a suitable filter for data)
Mon Mar  5 16:35:35 2018  [DEBUG] found end of postscript code (%%EOF)
Mon Mar  5 16:35:35 2018  [DEBUG] all data written to spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-994)
Mon Mar  5 16:35:35 2018  [DEBUG] trying to use PS title ((smbprn.00003231 my_document)
r a suitable filter for data)
Mon Mar  5 16:35:35 2018  [DEBUG] removing trailing newlines from title ((smbprn.00003231 my_document))
Mon Mar  5 16:35:35 2018  [DEBUG] removing enclosing parentheses () from full title ((smbprn.00003231 my_document))
Mon Mar  5 16:35:35 2018  [DEBUG] removing special characters from title (smbprn.00003231 my_document)
Mon Mar  5 16:35:35 2018  [DEBUG] title successfully retrieved (smbprn_00003231_my_document)
Mon Mar  5 16:35:35 2018  [DEBUG] input data read from stdin
Mon Mar  5 16:35:35 2018  [DEBUG] output filename created (/home/elvis/pdf/smbprn_00003231_my_document.pdf)
Mon Mar  5 16:35:35 2018  [DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/elvis/pdf/smbprn_00003231_my_document.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-994)
Mon Mar  5 16:35:35 2018  [DEBUG] output file unlinked (/home/elvis/pdf/smbprn_00003231_my_document.pdf)
Mon Mar  5 16:35:35 2018  [DEBUG] TMPDIR set for GhostScript (/var/tmp)
Mon Mar  5 16:35:35 2018  [DEBUG] waiting for child to exit
Mon Mar  5 16:35:35 2018  [DEBUG] entering child process
Mon Mar  5 16:35:35 2018  [DEBUG] GID set for current user
Mon Mar  5 16:35:35 2018  [DEBUG] supplementary groups set for current user
Mon Mar  5 16:35:35 2018  [DEBUG] UID set for current user (elvis)
Mon Mar  5 16:35:38 2018  [DEBUG] ghostscript has finished (0)
Mon Mar  5 16:35:38 2018  [DEBUG] file mode set for user output (/home/elvis/pdf/smbprn_00003231_my_document.pdf)
Mon Mar  5 16:35:38 2018  [DEBUG] postprocessing commandline built (/usr/sbin/rename_cups_pdf_output /home/elvis/pdf/smbprn_00003231_my_document.pdf elvis elvis)
Mon Mar  5 16:35:38 2018  [DEBUG] postprocessing has finished (0)
Mon Mar  5 16:35:38 2018  [DEBUG] spoolfile unlinked (/var/spool/cups-pdf/SPOOL/cups2pdf-994)
Mon Mar  5 16:35:38 2018  [DEBUG] all memory has been freed
Mon Mar  5 16:35:38 2018  [DEBUG] switching to new gid (lpadmin)
Mon Mar  5 16:35:38 2018  [DEBUG] initialization finished (v2.6.1)
Mon Mar  5 16:35:38 2018  [DEBUG] user identified (elvis)
Mon Mar  5 16:35:38 2018  [DEBUG] output directory name generated (/home/elvis/pdf)
Mon Mar  5 16:35:38 2018  [DEBUG] user information prepared
Mon Mar  5 16:35:38 2018  [DEBUG] spoolfile name created (/var/spool/cups-pdf/SPOOL/cups2pdf-1078)
Mon Mar  5 16:35:38 2018  [DEBUG] source stream ready
Mon Mar  5 16:35:38 2018  [DEBUG] destination stream ready (/var/spool/cups-pdf/SPOOL/cups2pdf-1078)
Mon Mar  5 16:35:38 2018  [DEBUG] owner set for spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-1078)
Mon Mar  5 16:35:38 2018  [DEBUG] using traditional fgets
Mon Mar  5 16:35:40 2018  [DEBUG] found beginning of postscript code (%!PS-Adobe-3.0)
Mon Mar  5 16:35:40 2018  [DEBUG] now extracting postscript code
Mon Mar  5 16:35:40 2018  [DEBUG] found title in ps code ((smbprn.00003232 my_document)
r a suitable filter for data)
Mon Mar  5 16:35:40 2018  [DEBUG] found end of postscript code (%%EOF)
Mon Mar  5 16:35:40 2018  [DEBUG] all data written to spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-1078)
Mon Mar  5 16:35:40 2018  [DEBUG] trying to use PS title ((smbprn.00003232 my_document)
r a suitable filter for data)
Mon Mar  5 16:35:40 2018  [DEBUG] removing trailing newlines from title ((smbprn.00003232 my_document))
Mon Mar  5 16:35:40 2018  [DEBUG] removing enclosing parentheses () from full title ((smbprn.00003232 my_document))
Mon Mar  5 16:35:40 2018  [DEBUG] removing special characters from title (smbprn.00003232 my_document)
Mon Mar  5 16:35:40 2018  [DEBUG] title successfully retrieved (smbprn_00003232_my_document)
Mon Mar  5 16:35:40 2018  [DEBUG] input data read from stdin
Mon Mar  5 16:35:40 2018  [DEBUG] output filename created (/home/elvis/pdf/smbprn_00003232_my_document.pdf)
Mon Mar  5 16:35:40 2018  [DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/elvis/pdf/smbprn_00003232_my_document.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-1078)
Mon Mar  5 16:35:40 2018  [DEBUG] output file unlinked (/home/elvis/pdf/smbprn_00003232_my_document.pdf)
Mon Mar  5 16:35:40 2018  [DEBUG] TMPDIR set for GhostScript (/var/tmp)
Mon Mar  5 16:35:40 2018  [DEBUG] waiting for child to exit
Mon Mar  5 16:35:40 2018  [DEBUG] entering child process
Mon Mar  5 16:35:40 2018  [DEBUG] GID set for current user
Mon Mar  5 16:35:40 2018  [DEBUG] supplementary groups set for current user
Mon Mar  5 16:35:40 2018  [DEBUG] UID set for current user (elvis)
Mon Mar  5 16:35:44 2018  [DEBUG] ghostscript has finished (0)
Mon Mar  5 16:35:44 2018  [DEBUG] file mode set for user output (/home/elvis/pdf/smbprn_00003232_my_document.pdf)
Mon Mar  5 16:35:44 2018  [DEBUG] postprocessing commandline built (/usr/sbin/rename_cups_pdf_output /home/elvis/pdf/smbprn_00003232_my_document.pdf elvis elvis)
Mon Mar  5 16:35:44 2018  [DEBUG] postprocessing has finished (0)
Mon Mar  5 16:35:44 2018  [DEBUG] spoolfile unlinked (/var/spool/cups-pdf/SPOOL/cups2pdf-1078)
Mon Mar  5 16:35:44 2018  [DEBUG] all memory has been freed


The line, "Mon Mar 5 16:35:35 2018 [DEBUG] now extracting postscript code" is the one that has my attention. About 5 seconds after this, the line "Mon Mar 5 16:35:40 2018 [DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/elvis/pdf/smbprn_00003232_my_document.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-1078)" shows the call to ghostscript, which is what I tried running on the raw printer output with success; so, it looks like cups is interpreting the postscript file and messing it up, then running the messed up output through ghostscript to convert it to pdf. Also it is painfully slow, taking an average of over 5 seconds per page of output to print from the windows machine to the linux machine. I don't think this should take so long for documents that are almost all text, no photographs, and occasionally some eps images of equations, which are also rendered text. Is there some way of avoiding this, and is there a more appropriate place to ask this question?

Thanks in advance,
lj
zapstrap
 
Posts: 36
Joined: 2010-02-03 03:00

Return to General Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable