Bug 319426 - Printing text-only PDF files results in empty pages
Summary: Printing text-only PDF files results in empty pages
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.16.2
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 19:45 UTC by Robi
Modified: 2013-05-18 13:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
example of not printable file (109.49 KB, application/pdf)
2013-05-07 12:19 UTC, Robi
Details
output of pdftops (707.11 KB, application/postscript)
2013-05-17 18:56 UTC, Robi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robi 2013-05-06 19:45:54 UTC
When printing (with any of my 2 printers) a PDF file containing text, results in a single blank page.
If the PDF file has an embedded image in it, that image is printed OK.

Reproducible: Always

Steps to Reproduce:
1. Create a text files and export it as PDF (i.e. using Open/Libre Office)
2. Open this PDF file with Okular 
3. Print it
Actual Results:  
The printer outputs a blank page

Expected Results:  
The printer outputs a correct print.

1. This problem doesn't show when printing from "evince" document reader (which led me to think it's an okular issue...).

2. CUPS log (set in "debug" mode) show an error in Ghostscript: googling around led me to these bugs: http://bugs.ghostscript.com/show_bug.cgi?id=691961 - http://bugs.ghostscript.com/show_bug.cgi?id=691985 (both with status "RESOLVED WORKSFORME") ;

3. Below, a snippet from CUPS error_log:
D [06/May/2013:20:08:19 +0200] [Job 262] GPL Ghostscript 9.05 (2012-02-08)
...
D [06/May/2013:20:08:19 +0200] [Job 262] Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusMonL-Regu.
D [06/May/2013:20:08:19 +0200] [Job 262] Can't find (or can't open) font file NimbusMonL-Regu.
D [06/May/2013:20:08:19 +0200] [Job 262] Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusMonL-Regu.
D [06/May/2013:20:08:19 +0200] [Job 262] Can't find (or can't open) font file NimbusMonL-Regu.
D [06/May/2013:20:08:19 +0200] [Job 262] Querying operating system for font files...
D [06/May/2013:20:08:19 +0200] [Job 262] Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusMonL-Regu.
D [06/May/2013:20:08:19 +0200] [Job 262] Can't find (or can't open) font file NimbusMonL-Regu.
D [06/May/2013:20:08:19 +0200] [Job 262] Didn't find this font on the system!
D [06/May/2013:20:08:19 +0200] [Job 262] Unable to substitute for font.
D [06/May/2013:20:08:19 +0200] [Job 262] Error: /invalidfont in /findfont
D [06/May/2013:20:08:19 +0200] [Job 262] Operand stack:
D [06/May/2013:20:08:19 +0200] [Job 262] F0_999999   1   1   --nostringval--   Courier
D [06/May/2013:20:08:19 +0200] [Job 262] Execution stack:
D [06/May/2013:20:08:19 +0200] [Job 262] %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1836   5   4   %oparray_pop
D [06/May/2013:20:08:19 +0200] [Job 262] Dictionary stack:
D [06/May/2013:20:08:19 +0200] [Job 262] --dict:1170/1684(ro)(G)--   --dict:0/20(G)--   --dict:84/200(L)--   --dict:67/75(L)--
D [06/May/2013:20:08:19 +0200] [Job 262] Current allocation mode is local
D [06/May/2013:20:08:19 +0200] [Job 262] Last OS error: 2
D [06/May/2013:20:08:19 +0200] [Job 262] GPL Ghostscript 9.05: Unrecoverable error, exit code 1
D [06/May/2013:20:08:19 +0200] [Job 262] renderer exited with status 1
D [06/May/2013:20:08:19 +0200] [Job 262] PID 19892 (/usr/libexec/cups/filter/foomatic-rip) did not catch or ignore signal 13.
D [06/May/2013:20:08:19 +0200] [Job 262] Possible error on renderer command line or PostScript error. Check options.DEBUG: Sent 0 bytes...
D [06/May/2013:20:08:19 +0200] [Job 262] Waiting for read thread to exit...
D [06/May/2013:20:08:19 +0200] [Job 262] PID 19893 (/usr/libexec/cups/backend/usb) exited with no errors.
D [06/May/2013:20:08:19 +0200] [Job 262] time-at-completed=1367863699
D [06/May/2013:20:08:19 +0200] Discarding unused job-completed event...
I [06/May/2013:20:08:19 +0200] [Job 262] Job completed.
Comment 1 Robi 2013-05-07 12:15:32 UTC
Just upgraded to KDE 4.10.3 and okular 0.16.3
The problem is still present but I must correct the step to reproduce: self-produced PDF files print as expected. The problem remains with some PDF files. I will provide an attachments with an example of such files .
Comment 2 Robi 2013-05-07 12:19:20 UTC
Created attachment 79752 [details]
example of not printable file

Printing the whole document, results in a single blank page.
Comment 3 Albert Astals Cid 2013-05-07 22:18:01 UTC
Does print preview show anything for you?
Comment 4 Albert Astals Cid 2013-05-07 22:18:23 UTC
Setting status correctly
Comment 5 Robi 2013-05-08 21:55:54 UTC
(In reply to comment #3)
> Does print preview show anything for you?

No, it doesn't: the preview pages are empty (shows only the okular icon on top left corner of each page)
Comment 6 Albert Astals Cid 2013-05-08 22:28:29 UTC
Which ghostscript and poppler versions are you running?
Comment 7 Robi 2013-05-09 08:59:47 UTC
(In reply to comment #6)
> Which ghostscript and poppler versions are you running?

Ghostscript v. 9.05
Poppler v. 0.22.2

Running Gentoo 64bit (amd64), all packages compiled with rather conservative options:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -mno-avx"
CXXFLAGS="${CFLAGS}"
Comment 8 Albert Astals Cid 2013-05-09 22:50:07 UTC
Can you try this?

Open a terminal, run
pdftops mypdffile.pdf
gs mypdffile.ps

Does it work?
Comment 9 Robi 2013-05-10 12:23:42 UTC
(In reply to comment #8)
> Can you try this?
> 
> Open a terminal, run
> pdftops mypdffile.pdf
> gs mypdffile.ps
> 
> Does it work?

Albert,
first of all thanks for your time spent in looking into this issue.

The command "pdftops myfile.pdf" works fine: a mypile.ps is produced in the same directory of the source PDF file.

The command "gs myfile.ps" fails with the following output:

GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Querying operating system for font files...
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Didn't find this font on the system!
Substituting font Courier for NimbusSanL-Regu.
Loading NimbusMonL-Regu font from /home/robi/.fonts/n/nimbusmonl.ttf... 3463880 2046935 4785472 3446373 1 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Bold.
Can't find (or can't open) font file NimbusSanL-Bold.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Bold.
Can't find (or can't open) font file NimbusSanL-Bold.
Didn't find this font on the system!
Unable to substitute for font.
Error: /invalidfont in /findfont
Operand stack:
   F10_0   1   1   --nostringval--   Helvetica-Bold
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1836   5   4   %oparray_pop
Dictionary stack:
   --dict:1160/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--   --dict:67/75(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 14585
GPL Ghostscript 9.05: Unrecoverable error, exit code 1
robi@clodius ~ $ gs -I /usr/share/fonts/urw-fonts Documenti/dsniff-n-mirror.ps
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /ioerror in --run--
Operand stack:
   --nostringval--   --nostringval--   (    )
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   --nostringval--
Dictionary stack:
   --dict:1160/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: 21
GPL Ghostscript 9.05: Unrecoverable error, exit code 1

Then i've tried to feed "gs" with an additional path for " NimbusSanL-Bold" font, of which I now it's installed in /usr/share/fonts/urw-fonts. I did this using -sFONTPATH option for "gs":

gs -sFONTPATH="/usr/share/fonts/urw-fonts" mypdf.ps
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Scanning /usr/share/fonts/urw-fonts for fonts... 108 files, 36 scanned, 35 new fonts.
Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb... 3540336 2206329 3894024 2600972 1 done.
Loading NimbusSanL-Bold font from /usr/share/fonts/urw-fonts/n019004l.pfb... 3662064 2323999 3914208 2615041 1 done.
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/urw-fonts/n021003l.pfb... 3829680 2488862 3914208 2625436 1 done.
Loading NimbusRomNo9L-Medi font from /usr/share/fonts/urw-fonts/n021004l.pfb... 3997184 2653648 3934392 2639289 1 done.
Loading NimbusMonL-Regu font from /usr/share/fonts/urw-fonts/n022003l.pfb... 4141048 2798050 3954576 2653542 1 done.
Loading NimbusRomNo9L-ReguItal font from /usr/share/fonts/urw-fonts/n021023l.pfb... 4305624 2953321 3954576 2663867 1 done.
Loading NimbusMonL-Bold font from /usr/share/fonts/urw-fonts/n022004l.pfb... 4449536 3104975 3974760 2677608 1 done.
Loading StandardSymL font from /usr/share/fonts/urw-fonts/s050000l.pfb... 4510088 3006001 3974760 2641149 1 done.
Loading NimbusRomNo9L-MediItal font from /usr/share/fonts/urw-fonts/n021024l.pfb... 4553272 3127029 3974760 2651474 1 done.
>>showpage, press <return> to continue<<


This time it worked...
Could it be a distro-specific problem?
Comment 10 Robi 2013-05-10 13:10:24 UTC
I've managed to export GS_FONTPATH and now "gs" works also without further options;
Now I'm able to see printing prewiev of the problematic PDF files from Okular, but still not able to actually print on paper. From CUPS error_log:

D [10/May/2013:14:59:44 +0200] [Job 289] Running cat | /usr/bin/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dAutoRotatePages=/None -dAutoFilterColorImages=false                -dNOPLATFONTS -dPARANOIDSAFER -dNOINTERPOLATE -sstdout=%stderr -dColorImageFilter=/FlateEncode                 -dPDFSETTINGS=/printer                 -dColorConversionStrategy=/LeaveColorUnchanged -dDoNumCopies -r600 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -sOutputFile=-  -c .setpdfwrite -f -
D [10/May/2013:14:59:44 +0200] [Job 289] Error: /invalidfont in /findfont
D [10/May/2013:14:59:44 +0200] [Job 289] Operand stack:
D [10/May/2013:14:59:44 +0200] [Job 289] F2_0   1   1   --nostringval--   Helvetica
D [10/May/2013:14:59:44 +0200] [Job 289] Execution stack:
D [10/May/2013:14:59:44 +0200] [Job 289] %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1882   1   3   %oparray_pop   1881   1   3   %oparray_pop   1865   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1840   5   4   %oparray_pop
D [10/May/2013:14:59:44 +0200] [Job 289] Dictionary stack:
D [10/May/2013:14:59:44 +0200] [Job 289] --dict:1174/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--   --dict:67/75(L)--
D [10/May/2013:14:59:44 +0200] [Job 289] Current allocation mode is local
D [10/May/2013:14:59:44 +0200] [Job 289] Last OS error: 2
D [10/May/2013:14:59:44 +0200] [Job 289] GPL Ghostscript 9.05: Unrecoverable error, exit code 1
D [10/May/2013:14:59:44 +0200] [Job 289] PID 4898 (/usr/libexec/cups/filter/pstopdf) stopped with status 1.
D [10/May/2013:14:59:44 +0200] [Job 289] PID 4899 (/usr/libexec/cups/filter/pdftopdf) exited with no errors.

Still something to do with "invalidfont"...
Comment 11 Albert Astals Cid 2013-05-16 20:45:02 UTC
Can you attach the output of running pdftops on the file to the bug?
Comment 12 Robi 2013-05-17 18:56:20 UTC
Created attachment 79940 [details]
output of pdftops
Comment 13 Albert Astals Cid 2013-05-17 19:12:57 UTC
Ah, forgot to read that exporting GS_FONTPATH you made gs work, yeah, that's sounding to me like a distro problem, you may want to check in some gentoo forum, since it works fine for me.

I'm going to close the bug now since the ps file we generate "works" and it seems you have some problem somewhere in the way from that ps file to the printer, maybe cups not finding your fonts or something.

If you find any proof that it is actually us doing something wrong, do not hesitate to reopen the bug.
Comment 14 Robi 2013-05-18 13:45:11 UTC
(In reply to comment #13)
> Ah, forgot to read that exporting GS_FONTPATH you made gs work, yeah, that's
> sounding to me like a distro problem, you may want to check in some gentoo
> forum, since it works fine for me.
> 
> I'm going to close the bug now since the ps file we generate "works" and it
> seems you have some problem somewhere in the way from that ps file to the
> printer, maybe cups not finding your fonts or something.
> 
> If you find any proof that it is actually us doing something wrong, do not
> hesitate to reopen the bug.

Thanks for your support. 
I will try to ask the gentoo forum.