Bug 691961 - Text missing in print
Summary: Text missing in print
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Text (show other bugs)
Version: 9.00
Hardware: PC Linux
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-14 08:49 UTC by devurandom
Modified: 2011-02-19 22:46 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
PDF showing the email which creates the problem (22.75 KB, application/pdf)
2011-02-14 08:49 UTC, devurandom
Details
Job data captured from /var/spool/cups (22.75 KB, application/postscript)
2011-02-14 10:36 UTC, devurandom
Details
Shell script to catch arguments and environment (1.09 KB, text/plain)
2011-02-19 22:46 UTC, Oldřich Jedlička
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devurandom 2011-02-14 08:49:53 UTC
Created attachment 7242 [details]
PDF showing the email which creates the problem

In KMail 1.13.6 I created an email with following content:
---
Test 123

:)

Test 345
---

When printing it, on the smiley is printed as a graphical emoticon, the text is not printed.

A print-to-pdf file is attached. It displays correctly in Okular, so maybe it does not contain the problem at all. If it does not, please advise me how to produce a proper testcase.

The version of Ghostscript used is Gentoo's app-text/ghostscript-gpl-9.00-r1 [1], which contains a set of patches [2].

Other software used:
net-print/cups-1.4.6
net-print/gutenprint-5.2.6

[1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-text/ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild?view=markup
[2] http://distfiles.gentoo.org/distfiles/ghostscript-gpl-9.00-patchset-2.tar.bz2
Comment 1 Ken Sharp 2011-02-14 09:02:04 UTC
(In reply to comment #0)

> When printing it, on the smiley is printed as a graphical emoticon, the text is
> not printed.
> 
> A print-to-pdf file is attached. It displays correctly in Okular, so maybe it
> does not contain the problem at all. If it does not, please advise me how to
> produce a proper testcase.

I'm not sure what the problem is here. Are you trying to print the attached PDF file using Ghostscript ? If so then the file renders correctly for me.

Ghostscript consumes either PDF or PostScript, if you are still having problems then what I need is the original PDF or PostScript file which is sent to Ghostscript, and the command line supplied to Ghostscript.

Trying ./gs email-without-text.print.pdf dispays the text properly for me on Windows and Fedora using the released 9.0 version of Ghostscript.
Comment 2 devurandom 2011-02-14 09:18:01 UTC
(In reply to comment #1)
> Ghostscript consumes either PDF or PostScript, if you are still having problems
> then what I need is the original PDF or PostScript file which is sent to
> Ghostscript, and the command line supplied to Ghostscript.
How do I make CUPS save that?

> Trying ./gs email-without-text.print.pdf dispays the text properly
I tried the command, too. I crashes:
---
$ gs Documents/email-without-text.print.pdf 
GPL Ghostscript  9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Error: /unknownerror in --run--
Operand stack:
   --dict:7/16(L)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--
Dictionary stack:
   --dict:1155/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:108/127(ro)(G)--   --dict:293/300(ro)(G)--   --dict:23/30(L)--   --dict:6/8(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--   --dict:7/15(L)--   --dict:1/1(ro)(G)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript  9.00: Unrecoverable error, exit code 1
---
Comment 3 Ken Sharp 2011-02-14 09:30:52 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Ghostscript consumes either PDF or PostScript, if you are still having problems
> > then what I need is the original PDF or PostScript file which is sent to
> > Ghostscript, and the command line supplied to Ghostscript.
> How do I make CUPS save that?

I'm sorry I am not a CUPS expert, I have no idea.

 
> > Trying ./gs email-without-text.print.pdf dispays the text properly
> I tried the command, too. I crashes:
> ---
> $ gs Documents/email-without-text.print.pdf 
> GPL Ghostscript  9.00 (2010-09-14)
> Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
> This software comes with NO WARRANTY: see the file PUBLIC for details.
> Processing pages 1 through 1.
> Page 1
> Error: /unknownerror in --run--

This is not a crash, it is a graceful exit due to an error. 

I'm not certain what is causing the error though. You might try upgrading to the current version, 9.01 was released last week. What happens if you simply invoke Ghostscript with no parameters ?
Comment 4 Chris Liddell (chrisl) 2011-02-14 09:46:24 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Ghostscript consumes either PDF or PostScript, if you are still having problems
> > then what I need is the original PDF or PostScript file which is sent to
> > Ghostscript, and the command line supplied to Ghostscript.
> How do I make CUPS save that?

See here for details:

https://wiki.edubuntu.org/DebuggingPrintingProblems#Capturing%20print%20job%20data
Comment 5 devurandom 2011-02-14 10:06:22 UTC
(In reply to comment #3)
> I'm not certain what is causing the error though. You might try upgrading to
> the current version, 9.01 was released last week. What happens if you simply
> invoke Ghostscript with no parameters ?
An empty window is displayed and a command prompt is created on the console.

I'll request packaging 9.01 in Gentoo, with less patches hopefully. I'll test again when that's done.
Comment 6 Ken Sharp 2011-02-14 10:19:07 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > I'm not certain what is causing the error though. You might try upgrading to
> > the current version, 9.01 was released last week. What happens if you simply
> > invoke Ghostscript with no parameters ?
> An empty window is displayed and a command prompt is created on the console.

Well that tells us that Ghostscript is at least running, so its built and installed correctly. You can get rid of the running instance by typing quit at the GS> prompt.

 
> I'll request packaging 9.01 in Gentoo, with less patches hopefully. I'll test
> again when that's done.

I'm not certain this will resolve your problem. Your PDF file works here on 9.0 and 9.01, but it doesn't appear to be the file which you are sending to Ghostscript.

While its possible that you have found a bug which has been fixed over the last 6 months, its equally likely that 9.01 will have the same problem, and you'll be back in this situation again. It really is worthwhile trying to get the PostScript file from CUPS and letting us take a look at it.
Comment 7 devurandom 2011-02-14 10:36:25 UTC
Created attachment 7243 [details]
Job data captured from /var/spool/cups
Comment 8 Ken Sharp 2011-02-14 10:47:46 UTC
Hmm, interesting, it really is a PDF file (not a PostScript file as implied by the .ps suffix).

The file works for me on both Ghostscript 9.0 and 9.01. Its possible that there is some command line switch which is causing the problem, in which case I would not expect it to be resolved by moving to 9.01.

But, without knowing how CUPS is invoking Ghostscript, there isn't really a lot I can offer in the way of advice.

I'm going to close this as 'WORKSFORME', feel free to reopen it if you can find a Ghostscript command line which shows the problem.
Comment 9 Chris Liddell (chrisl) 2011-02-14 10:53:38 UTC
FWIW, it also works as expected with the gs 8.71 default install on Ubuntu 10.10.
Comment 10 devurandom 2011-02-14 11:03:36 UTC
(In reply to comment #8)
> But, without knowing how CUPS is invoking Ghostscript, there isn't really a lot
> I can offer in the way of advice.
I have "LogLevel debug2" enabled in cupsd.conf, but the log does not contain anything about the invocation of ghostscript. I thought from previous debugging sessions that (a) CUPS would always push its input through GS, and (b) that the literal output of that command would appear in the logs. Seems I'm remembering wrongly.

I can however print to PostScript first and then print that using "lp <file>", so it's a WORKSFORME, too.

P.S: The last attachment might be any format, I just assumed it is PS and named it this way.
Comment 11 Oldřich Jedlička 2011-02-19 08:59:09 UTC
From the comments I can see the problem still presists. I have done some investigations with CUPS filter already (I have a different problem), so I can help in this area.
Comment 12 devurandom 2011-02-19 19:25:30 UTC
Over at the Gentoo bugzilla [1] someone else reported having the same problem depending on whether he uses GS 9.x or 8.x:
---
I have an HP 1018 LaserJet Printer with =app-text/ghostscript-gpl-9.00-r1 and
=net-print/hplip-3.11.1-r2. I am running Gentoo on ~amd64. I tried printing a
newegg order invoice today. The newegg logo and hyperlink text printed, but all
of the plaintext (bold or otherwise) was missing. I downgraded to
app-text/ghostscript-gpl-8.71-r6 and it printed without a problem.
---

For me it was quite the same: The smiley and the box around the header printed fine, but all regular text was missing.

Oldřich:
What is probably needed now is figuring out how CUPS calls GS for printing this file, so it can be reproduced without going through CUPS and KDE-Printing.

[1] http://bugs.gentoo.org/show_bug.cgi?id=341207#c26
Comment 13 devurandom 2011-02-19 22:04:14 UTC
Richard, the reporter of the Gentoo bug wants to get this passed on to you:
---
I can reproduce this on my system very easily by trying to print newegg.com
invoices. I suspect that the issue has something to do with the specific font
that newegg uses for their invoices, but I have not done extensive testing to
be certain.

I was going through a backlog of rebate applications yesterday, so I had to
print all sorts of things. I recall seeing graphical corruption (white spots)
in a barcode that was printed on one of the rebate forms. I wasted a dozen
pieces of paper trying to print things until I thought of trying to go back to
the older version of ghostscript-gpl. None of these issues appear with it.
---
I already asked him for a testcase.
Comment 14 Oldřich Jedlička 2011-02-19 22:46:55 UTC
Created attachment 7263 [details]
Shell script to catch arguments and environment

Use the attached script to capture the ghostscript arguments and generated output. It cannot capture input, though.

Everything should be done as root (so a BIG warning here). Go to the place, where you have ghostscript executable. On my system the executable is at /usr/bin/gs. Rename it to have ".bin" at the end (`cd /usr/bin; mv gs gs.bin`), the resulting full path is /usr/bin/gs.bin. Take the attached file and save it to the same place as the original ghostscript (/usr/bin/gs), make it executable (`chmod ugo+x /usr/bin/gs`) and try to print. You should have a new file /tmp/cups-gs-<date>-<time>.<nanosecond>.log with environment and command line arguments, also /tmp/cups-pipe/gs-<date>-<time>.<nanosecond>.log with output.

The attached script can be used also in /usr/libexec/cups/filters to capture output of other filters. Just store it in /usr/libexec/cups/filters, rename the filter to "<name>.bin", create a symbolic link that points to the attached script and give it a name "<name>". I used it with pstops and pstoraster, but for pdf you might need to wrap pdftops and/or pdftoraster.