Bug 70358 - No print preview - error
Summary: No print preview - error
Status: CLOSED FIXED
Alias: None
Product: kdeprint
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Goffioul
URL:
Keywords:
: 75253 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-14 01:27 UTC by info
Modified: 2008-12-31 13:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Print preview file (179.84 KB, text/plain)
2004-01-06 15:06 UTC, info
Details
Result from gs command (50.09 KB, text/plain)
2004-01-06 15:08 UTC, info
Details

Note You need to log in before you can comment on or make changes to this bug.
Description info 2003-12-14 01:27:47 UTC
Version:            (using KDE KDE 3.1.94)
Installed from:    RedHat RPMs

Previewing print pages doesn't work - I tried from several applications (konqueror, korganizer, kmail). 

For example in konqueror, looking at a web page:
Select "print" 
In the print dialogue, check "Preview" and OK.

Then I get an error message:
Öffnen nicht möglich (=Cannot open)
/tmp/kde-stephan/kdeprint_vQVPbT9d

after clicking on ok, I get the preview window but completely empty (gray) except for the "print" and "cancel" buttons (in the center left, not at the bottom). No preview!

I checked that the file is there:
$ ls -l /tmp/kde-stephan/kdeprint_vQVPbT9d
-rw-rw-r--    1 stephan  stephan    219459 13. Dez 23:58 /tmp/kde-stephan/kdeprint_vQVPbT9d

It seems a valid Postscript file, I can open it with
$ kghostview /tmp/kde-stephan/kdeprint_vQVPbT9d
and it looks as expected.

Also, printing works fine.

Here is my setup:
Fedora Core 1, essentially standard distribution
KDE 3.2b from Fedora RPMs from the KDE website
Before I used KDE 3.1.4 (?) from the Fedora distribution - no problems with print preview, but perhaps there is an old setting somewhere?
Printing system is CUPS, and I have drivers for a network printer (standard postscript) and a local inkjet printer (which doesn't work, but that's a different issue). It doesn't matter which print driver I select.

Here are the error messages when I start konqueror from command line and try to preview a page (example: www.google.com):

[stephan@Godzilla-PC kde-stephan]$ konqueror
ypcat: Kann die lokale NIS Domain nicht bestimmen: Der lokale Domain-Name ist nicht eingetragen
[1] Wrote 1 pages, 184786 bytes
parsing started
size is 4
parsing finished
command to execute is (gs -q -dBATCH -dNOPAUSE -dSAFER -dNODISPLAY ps2ai.ps '/tmp/kde-stephan/kdeprint_PUjh2CHk' | sed -e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 0 0 595 842/g" > '/tmp/kde-stephan/konquerorHV80qb.tmp')
unknown operator: Adobe_packedarray
pushing Adobe_packedarray to stack
unknown operator: Adobe_cmykcolor
pushing Adobe_cmykcolor to stack
unknown operator: Adobe_cshow
pushing Adobe_cshow to stack
unknown operator: Adobe_customcolor
pushing Adobe_customcolor to stack
unknown operator: Adobe_typography_AI3
pushing Adobe_typography_AI3 to stack
unknown operator: Adobe_IllustratorA_AI3
pushing Adobe_IllustratorA_AI3 to stack
unknown operator: To
pushing To to stack
unknown operator: Tp
.....
(lots of the same)
.....
unknown operator: TC
pushing TC to stack
state start / start char  (0)
parsing aborted
[stephan@Godzilla-PC kde-stephan]$

When I print directly (no preview), then I get the following messages, and it prints ok:

[stephan@Godzilla-PC kde-stephan]$ konqueror
ypcat: Kann die lokale NIS Domain nicht bestimmen: Der lokale Domain-Name ist nicht eingetragen
[1] Wrote 1 pages, 184786 bytes
[stephan@Godzilla-PC kde-stephan]$

Hope that helps you to find the problem... let me know if you need more info!

Thanks
Stephan
Comment 1 info 2003-12-14 01:38:11 UTC
Hi again,

it just occurred to me to try the gs command in the error message. (of course the filename is different now)

[stephan@Godzilla-PC stephan]$ gs -q -dBATCH -dNOPAUSE -dSAFER -dNODISPLAY ps2ai.ps '/tmp/kde-stephan/kdeprint_ASC0DGiz' | sed -e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 0 0 595 842/g" > '/tmp/kde-stephan/konquerorV6jVwa.tmp'
[stephan@Godzilla-PC stephan]$ ls -l /tmp/kde-stephan/konquerorV6jVwa.tmp
-rw-rw-r--    1 stephan  stephan     43424 14. Dez 00:35 /tmp/kde-stephan/konquerorV6jVwa.tmp
[stephan@Godzilla-PC stephan]$

So, no gs error. But the preview didn't work this time either.

But, trying to look at the resulting .tmp file:

[stephan@Godzilla-PC stephan]$ kghostview /tmp/kde-stephan/konquerorV6jVwa.tmp
ASSERT: "m" in kgvdocument.cpp (465)
[stephan@Godzilla-PC stephan]$

and kghostview crashes (and the KDE crashmanager comes up).

Hope this helps!
Cheers
Stephan
Comment 2 Michael Goffioul 2003-12-19 12:22:42 UTC
Could you check if you have some filter attached to the printer? (in the printer properties dialog -> "Filters" tab). If yes remove. From the debug output you reported, it looks like something is executed before the preview is started.

Michael.
Comment 3 info 2003-12-19 19:30:10 UTC
Thanks for your help!

I removed all filters now from the printers dialogue, and it's still the same. Also I made sure that the printer driver uses default values for margins and other settings in the dialogue. 

I see your point from the output, but I can't figure out where and why this filter is called. 

The output shows that ps2ai.ps is called. This is in /usr/share/ghostscript/7.07/lib/ps2ai.ps and says:
ps2ai.ps - a postscript to editable adobe illustrator file filter

I don't know what it is for.

Why is this filter only called for preview, not for printing? Printing is fine.

I have two different printer drivers, using CUPS
General Postscript, Foomatic + Postscript (recommended)
Lexmark 3200, Foomatic + lm3200 (recommended)

Stephan
Comment 4 Michael Goffioul 2004-01-05 11:39:35 UTC
Subject: RE:  No print preview - error         

> I removed all filters now from the printers dialogue, and 
> it's still the same. Also I made sure that the printer driver 
> uses default values for margins and other settings in the dialogue. 

Does this mean that the filter output (looks like enscript
output to me) is still present? Even when simply printing,
no preview?

> 
> I see your point from the output, but I can't figure out 
> where and why this filter is called. 
> 
> The output shows that ps2ai.ps is called. This is in 
> /usr/share/ghostscript/7.07/lib/ps2ai.ps and says:
> ps2ai.ps - a postscript to editable adobe illustrator file filter
> 
> I don't know what it is for.

Me neither. KDEPrint uses the kghostview part to view
the print file generated by the application. The rest is
kghostview (Luis, as kghostview bug responsible, could
you have a look?).

> Why is this filter only called for preview, not for printing? 
> Printing is fine.

Looking at your initial bug report, the "weird" output is also
there when you simply print with no preview. I don't know where
it comes from, however.

Michael.

Comment 5 info 2004-01-06 15:03:40 UTC
Hi Michael,

thanks for your help. I'm not sure I understand your questions exactly. Sorry if I repeat what you already know...

> Looking at your initial bug report, the "weird" output is also
> there when you simply print with no preview.

I don't think so. The first line in the output (the ypcat thing) came from something different (some wrong setting in the DNS system?), that doesn't come up any more. Without preview I do not get any error or weird output, only with preview.

Here is the situation now: I just tried again, same procedure in the initial report. I started konqueror from command line, called www.google.com and tried to print, making sure that no filters are set in the print dialogue

Situation 1.: Direct printing, no preview: Page comes out of the printer perfectly fine, no error message at all on the command line (even the "Wrote 1 page" is not there - that might have been some filter).

Situation 2: with preview, all other settings as in situation 1. Again the error box with 
Öffnen nicht möglich (= cannot open)
/tmp/kde-stephan/kdeprint_XigKGTQM
then the empty preview window, and on the command line the following output:

[stephan@Godzilla-PC stephan]$ konqueror
parsing started
size is 4
parsing finished
command to execute is (gs -q -dBATCH -dNOPAUSE -dSAFER -dNODISPLAY ps2ai.ps '/tmp/kde-stephan/kdeprint_XigKGTQM' | sed -e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 0 0 595 842/g" > '/tmp/kde-stephan/konquerorsxjqVb.tmp')
unknown operator: Adobe_packedarray
pushing Adobe_packedarray to stack
etc. etc.
---
So, this program is only called for preview, and fails. The file /tmp/kde-stephan/kdeprint_XigKGTQM exists and I can open it with Kghostview, but 
/tmp/kde-stephan/konquerorsxjqVb.tmp (the output from the gs command) does not exist. But I can produce the .tmp file by copying the gs command to the command line. But the resulting file crashes kghostview (see previous report).

I see two points here:
1. For the preview kghostview tries to call ghostscript, and this fails, although the command works from the command line.

2. When executing the gs command from the command line, the result is not readable.

So perhaps it is a problem with my ghostscript? But I'm using the standard Fedora ghostscript:
[stephan@Godzilla-PC stephan]$ rpm -qa | grep ghostscript
ghostscript-7.07-11
ghostscript-fonts-5.50-9

Perhaps you can try the following: 
I attach the files kdeprint_ZT9iPZLW and konquerorX2jmkc.tmp
I produced the second one by calling
gs -q -dBATCH -dNOPAUSE -dSAFER -dNODISPLAY ps2ai.ps 'kdeprint_ZT9iPZLW' | sed -e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 0 0 595 842/g" > 'konquerorX2jmkc.tmp'
This file is not readable (kghostview crashes)
Perhaps you can try the same and see if you get something reasonable. If it works for you, then the problem might be my ghostscript.

Just to make sure that it is not a konqueror thing: I just tried with kedit. the command line output is:

[stephan@Godzilla-PC stephan]$ kedit test
parsing started
size is 4
parsing finished
command to execute is (gs -q -dBATCH -dNOPAUSE -dSAFER -dNODISPLAY ps2ai.ps '/tm
p/kde-stephan/kdeprint_kKG8tfCu' | sed -e "s/%%BoundingBox: 0 0 612 792/%%Boundi
ngBox: 0 0 595 841/g" > '/tmp/kde-stephan/kedit8JycFb.tmp')
unknown operator: Adobe_packedarray
pushing Adobe_packedarray to stack
...
unknown operator: TO
pushing TO to stack
before save document
after save document
QObject::connect: Cannot connect KStatusBarLabel::itemPressed(int) to (null)::pr           essed(int)
QObject::connect: Cannot connect KStatusBarLabel::itemReleased(int) to (null)::r           eleased(int)
ASSERT: "sb" in koView.cc (420)
QObject::connect: Cannot connect KStatusBarLabel::itemPressed(int) to (null)::pr           essed(int)
QObject::connect: Cannot connect KStatusBarLabel::itemReleased(int) to (null)::r           eleased(int)
ASSERT: "sb" in koView.cc (420)
[stephan@Godzilla-PC stephan]$

And kedit crashes, with the KDE crashmanager coming up (no preview window at all, not even an empty one).

Cheers
Stephan
Comment 6 info 2004-01-06 15:06:46 UTC
Created attachment 3995 [details]
Print preview file

This is an example for a file that the previews tries to process through the gs
command:
gs -q -dBATCH -dNOPAUSE -dSAFER -dNODISPLAY ps2ai.ps 'kdeprint_ZT9iPZLW' | sed
-e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 0 0 595 842/g" >
'konquerorX2jmkc.tmp'
Comment 7 info 2004-01-06 15:08:19 UTC
Created attachment 3996 [details]
Result from gs command

The resulting file from the gs command, when gs is called from command line.
Comment 8 info 2004-02-03 13:31:29 UTC
Hi,

The problem seems to be the gs command. I just tried it on a Sun Solaris System and it produces again unreadable output.

Either there is a bug in gs or ps2ai or kde doesn't pass the correct arguments.

I still don't know WHY the gs command is called at all (I have no filters defined). It's only called for the preview. Perhaps we can get to the bottom of this if we can find out whether it should be called at all and what it is supposed to do.

Sorry that I can't be of more help.

Cheers
Stephan
Comment 9 David P James 2004-02-05 19:14:41 UTC
I too can confirm what the reporter is seeing (3.1.95 - waiting for the 3.2 debs to make their way into Sid).

However, I noticed something odd; I recently created a new user account for my girlfriend and there the print preview works just fine, yet on my user account it does not. Since her .kde dir is new and mine is not it might be an issue with older kde profiles.
Comment 10 info 2004-02-06 13:16:27 UTC
Hi again,

Yes, could be related to upgrade to 3.2. I never had the problem before upgrading to 3.2.

I found a similar report on the German SuSE list from somebody who experienced it after upgrading to KDE 3.2 (he didn't find a solution)
http://lists.suse.com/archive/suse-laptop/2003-Nov/0104.html
http://lists.suse.com/archive/suse-laptop/2003-Nov/0135.html
http://lists.suse.com/archive/suse-laptop/2003-Nov/0159.html

I don't want to delete all my .kde settings. But I tried to experiment woth ressource files that seem to have to do with printing. So I deleted:
.kde/share/config/kdeprintrc
.kde/share/config/kprinterrc
.kde/share/config/kghostviewrc

But it did not solve the problem. Which other files could be relevant?

Cheers
Stephan
Comment 11 Jan Schaefer 2004-02-16 10:58:12 UTC
*** Bug 75253 has been marked as a duplicate of this bug. ***
Comment 12 Michael Goffioul 2004-02-24 11:07:11 UTC
KDEPrint does not call "gs" directly: it loads the kghostview part and load the generated PS file (coming from the application) into that part. So in the end, "gs" is called by kghostview.
What you can try is to print to a PS file, then view this file with kghostview. I have the impression that either the generated PS file is faulty and kghostview is not able to open it correctly, or kghostview is wrong when opening a valid (but maybe special) PS file. In both cases, this is out of control of KDEPrint.
Comment 13 info 2004-02-24 13:03:22 UTC
Jippieh! SOLVED!

Hi Michael,

thanks for your comment, which helped me to find the problem.

The problem was that the default embedded viewer for Postscript files was set to Karbon14 rather than Kghostview. And Karbon14 can't open it.

Possibly this is a wrong default setting in some packages? I'm quite sure that I never changed that setting deliberately, and it started when I updated to KDE 3.2. 

So for anybody who has the same problem:
Go to "file associations" in the konqueror configure dialoge
Find application/postscript
Make sure that the embedded viewer is Kghostview, not Karbon14.

Thanks a lot for your help!

Stephan
Comment 14 Michael Goffioul 2004-02-24 13:45:32 UTC
Let's close it then.

Comment 15 John Layt 2008-12-31 13:25:54 UTC
Closing old Resolved status bug.