Skip to main content
Topic: cups-pdf print blank pages from some applications (Read 122 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

cups-pdf print blank pages from some applications

Hello,
I use printer or print things only once in a while so I do not keep an eye on this feature.

So my problem is that cups-pdf prints blank pages when it is called from qt5 application like Kate or Falkon.
And it surprisingly works in GTK ones like Geany or Palemoon.

I know that the Print dialog itself contains feature called "Print to file" which can be used as workaround, but it is more work than just clicking print and letting cups do all the work.

To fix this bug I tried many things, I resetted all option in conf files, installed newest updates, searched wiki / internet, cursed devs and so on.... but nothing changed the result.

The created pdf file is around 2.3Kib big with set title, creator, time etc. but is completly blank.

I also have installed and running some printing applet (/usr/share/system-config-printer/applet.py) which shows icon in tray when cups is working.
When running task issued by Falkon or Kate icon is there only for a moment and PDF fiel is empty.
When running task issued by PaleMoon iit shows up for much longer time and PDF is filled with data.

So my guess is that there is some kind of an error when processing tasks from Kate (see cups-pdf.log)
Code: [Select]
Wed Jan 23 18:52:12 2019  [DEBUG] ghostscript has finished: 256

So here is the cups-pdf.log when printing from kate:
Code: [Select]
Wed Jan 23 18:52:11 2019  [DEBUG] *** Final Configuration ***
Wed Jan 23 18:52:11 2019  [DEBUG] AnonDirName        = "/var/spool/cups-pdf/ANONYMOUS"
Wed Jan 23 18:52:11 2019  [DEBUG] AnonUser           = "nobody"
Wed Jan 23 18:52:11 2019  [DEBUG] GhostScript        = "/usr/bin/gs"
Wed Jan 23 18:52:11 2019  [DEBUG] GSCall             = "%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="%s" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f %s"
Wed Jan 23 18:52:11 2019  [DEBUG] Grp                = "lp"
Wed Jan 23 18:52:11 2019  [DEBUG] GSTmp              = "TMPDIR=/var/tmp"
Wed Jan 23 18:52:11 2019  [DEBUG] Log                = "/var/log/cups"
Wed Jan 23 18:52:11 2019  [DEBUG] PDFVer             = "1.4"
Wed Jan 23 18:52:11 2019  [DEBUG] PostProcessing     = ""
Wed Jan 23 18:52:11 2019  [DEBUG] Out                = "${HOME}/PDF"
Wed Jan 23 18:52:11 2019  [DEBUG] Spool              = "/var/spool/cups-pdf/SPOOL"
Wed Jan 23 18:52:11 2019  [DEBUG] UserPrefix         = ""
Wed Jan 23 18:52:11 2019  [DEBUG] RemovePrefix       = ""
Wed Jan 23 18:52:11 2019  [DEBUG] OutExtension       = "pdf"
Wed Jan 23 18:52:11 2019  [DEBUG] Cut                = 3
Wed Jan 23 18:52:11 2019  [DEBUG] Truncate           = 64
Wed Jan 23 18:52:11 2019  [DEBUG] DirPrefix          = 0
Wed Jan 23 18:52:11 2019  [DEBUG] Label              = 1
Wed Jan 23 18:52:11 2019  [DEBUG] LogType            = 7
Wed Jan 23 18:52:11 2019  [DEBUG] LowerCase          = 1
Wed Jan 23 18:52:11 2019  [DEBUG] TitlePref          = 0
Wed Jan 23 18:52:11 2019  [DEBUG] DecodeHexStrings   = 0
Wed Jan 23 18:52:11 2019  [DEBUG] FixNewlines        = 0
Wed Jan 23 18:52:11 2019  [DEBUG] AllowUnsafeOptions = 0
Wed Jan 23 18:52:11 2019  [DEBUG] AnonUMask          = 0000
Wed Jan 23 18:52:11 2019  [DEBUG] UserUMask          = 0077
Wed Jan 23 18:52:11 2019  [DEBUG] *** End of Configuration ***
Wed Jan 23 18:52:11 2019  [DEBUG] set new gid: lp
Wed Jan 23 18:52:11 2019  [DEBUG] initialization finished: v3.0.1
Wed Jan 23 18:52:11 2019  [DEBUG] user identified: juraj
Wed Jan 23 18:52:11 2019  [DEBUG] output directory name generated: /home/juraj/PDF
Wed Jan 23 18:52:11 2019  [DEBUG] user information prepared
Wed Jan 23 18:52:11 2019  [DEBUG] spoolfile name created: /var/spool/cups-pdf/SPOOL/cups2pdf-21885
Wed Jan 23 18:52:11 2019  [DEBUG] source stream ready
Wed Jan 23 18:52:11 2019  [DEBUG] destination stream ready: /var/spool/cups-pdf/SPOOL/cups2pdf-21885
Wed Jan 23 18:52:11 2019  [DEBUG] owner set for spoolfile: /var/spool/cups-pdf/SPOOL/cups2pdf-21885
Wed Jan 23 18:52:11 2019  [DEBUG] using traditional fgets
Wed Jan 23 18:52:12 2019  [DEBUG] found beginning of postscript code: %!PS-Adobe-3.0

Wed Jan 23 18:52:12 2019  [DEBUG] now extracting postscript code
Wed Jan 23 18:52:12 2019  [DEBUG] found title in ps code: (Untitled)
/PDF
Wed Jan 23 18:52:12 2019  [DEBUG] found embedded (e)ps code: %!PS-Adobe-3.0

Wed Jan 23 18:52:12 2019  [DEBUG] found end of embedded (e)ps code: %%EOF

Wed Jan 23 18:52:12 2019  [DEBUG] found end of postscript code: %%EOF

Wed Jan 23 18:52:12 2019  [DEBUG] all data written to spoolfile: /var/spool/cups-pdf/SPOOL/cups2pdf-21885
Wed Jan 23 18:52:12 2019  [DEBUG] trying to use PS title: (Untitled)
/PDF
Wed Jan 23 18:52:12 2019  [DEBUG] removing special characters from title: (Untitled)
/PDF
Wed Jan 23 18:52:12 2019  [DEBUG] removing leading _ from title: _Untitled___PDF
Wed Jan 23 18:52:12 2019  [DEBUG] title successfully retrieved: job_91-Untitled___PDF
Wed Jan 23 18:52:12 2019  [DEBUG] input data read from stdin
Wed Jan 23 18:52:12 2019  [DEBUG] output filename created: /home/juraj/PDF/job_91-Untitled___PDF.pdf
Wed Jan 23 18:52:12 2019  [DEBUG] ghostscript commandline built: /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/juraj/PDF/job_91-Untitled___PDF.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-21885
Wed Jan 23 18:52:12 2019  [DEBUG] output file unlinked: /home/juraj/PDF/job_91-Untitled___PDF.pdf
Wed Jan 23 18:52:12 2019  [DEBUG] TMPDIR set for GhostScript: /var/tmp
Wed Jan 23 18:52:12 2019  [DEBUG] waiting for child to exit
Wed Jan 23 18:52:12 2019  [DEBUG] entering child process
Wed Jan 23 18:52:12 2019  [DEBUG] GID set for current user
Wed Jan 23 18:52:12 2019  [DEBUG] supplementary groups set for current user
Wed Jan 23 18:52:12 2019  [DEBUG] UID set for current user: juraj
Wed Jan 23 18:52:12 2019  [DEBUG] ghostscript has finished: 256
Wed Jan 23 18:52:12 2019  [DEBUG] file mode set for user output: /home/juraj/PDF/job_91-Untitled___PDF.pdf
Wed Jan 23 18:52:12 2019  [DEBUG] no postprocessing
Wed Jan 23 18:52:12 2019  [DEBUG] spoolfile unlinked: /var/spool/cups-pdf/SPOOL/cups2pdf-21885
Wed Jan 23 18:52:12 2019  [DEBUG] all memory has been freed
Wed Jan 23 18:52:12 2019  [STATUS] PDF creation successfully finished for juraj

and here cups error.log:
https://paste.artixlinux.org/view/438eb813

Hunting log:
  • Not sole problem of my machine > link
  • Not a problem of cups > link
  • Hunting Ghostscript > link

Hunting results:
  • Found bug in Falkon > link
Mna is as good as his tools.

Re: cups-pdf print blank pages from some applications

Reply #1
The problem probably lies with Qt sending malformed data to ghostscript, the same is happening to me.