Bug 114592

Summary: kde print pdf problem
Product: [Unmaintained] kdeprint Reporter: Marc Collin <marc.collin>
Component: generalAssignee: Cristian Tibirna <tibirna>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Testcase for gs crash
PDF generated with Ghostscript's "compatibility level" option set to 1.2

Description Marc Collin 2005-10-18 03:38:56 UTC
Version:            (using KDE KDE 3.4.3)
Installed from:    SuSE RPMs
OS:                Linux

hi

when i try to print to pdf printer (konqueror) i get something like

A print error occurred. Error message received from system:

gs -q -dSAFER -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out{/home/collinm/print3.pdf} -sPAPERSIZE=letter -c .setpdfwrite -f '/tmp/kde-collinm/konquerorl3KVea.ps' : execution failed with message:
Error: /undefine in --get- Operand stack: (!) 0.5 --dict:14/17(ro)(L)-- 33 space --dict:2/2(ro)(L)-- space Execution stack: %interp_exi .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- -- ostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparra _pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %finish_stringwidth --nostringval-- --nostringval-- 9 10 2 --nostringval-- (gs_show_enum) %op_show_continue -nostringval-- --nostringval-- Dictionary stack: --dict:1133/3371(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)-- --dic :59/75(L)-- --dict:12/15(L)-- --dict:0/15(L)-- --dict:0/15(L)-- --dict:0/15(L)-- --dict:0/15(L)-- --dict:5/15(L)-- --dict:14/17(ro)(L)-- Current allocation mode is local Last OS error: 2 Current file position is 875486 ESP Ghostscript 8.15. : Unrecoverable error, exit code 1 

if i use kghostview, i don't have any problem...

any idea?
Comment 1 Thiago Macieira 2005-10-18 03:45:55 UTC
Cristian: is this a problem in the PS generator or in KDEPrint?
Comment 2 Cristian Tibirna 2005-10-18 04:04:51 UTC
Well, depends. Bug could prove to be in
1) Qt, which seems to generate PS code that gs can't convert to PDF 1.3
2) gs, which might prove to have a bug in the PS to PDF-1.3 conversion.

Usually, PS to PDF-1.2 conversion seems to always work, for the same PS code that fails at PS to PDF-1.3 conversion. (See bug 107991)

It might even be considered a bug in kdeprint, which doesn't try to enforce the conversion to PDF-1.2 (but I consider this enforcement to be a workaround and I won't apply it in kdeprint until I don't find who's the culprit: qt or gs, or what the real problem is).
Comment 3 Cristian Tibirna 2005-10-18 04:06:18 UTC
hmmm. I might have hurried a bit with my comments. It's not the exact same problem as in bug 107991, but might prove to be related.
Comment 4 Marc Collin 2005-10-18 04:31:50 UTC
i tried to print to pdf this page: http://packman.links2linux.org/?action=599

i get

A print error occurred. Error message received from system:

Abnormal process termination (gs -q -dSAFER -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out{/home/collinm/print4.pdf} -sPAPERSIZE=letter -c .setpdfwrite -f '/tmp/kde-collinm/kdeprint_4HiHAIIW' ).

is there a way to give you more information to tried to solve this problem?
Comment 5 Cristian Tibirna 2005-10-18 04:49:02 UTC
On 17 October 2005 22:31, Marc Collin wrote:
>
> A print error occurred. Error message received from system:
>
> Abnormal process termination (gs -q -dSAFER -dPARANOIDSAFER -dNOPAUSE
> -dBATCH -sDEVICE=pdfwrite -sOutputFile=$out{/home/collinm/print4.pdf}
> -sPAPERSIZE=letter -c .setpdfwrite -f '/tmp/kde-collinm/kdeprint_4HiHAIIW'
> ).
>
> is there a way to give you more information to tried to solve this problem?


Ah, then I already know about this. It's the same bug that I write about in 
the previous comments. Please read those for details.

As I said, I don't think it has anything to do with kdeprint (apart that 
there's a possible workaround to be applied to kdeprint).
Comment 6 Marc Collin 2005-10-18 05:43:31 UTC
other information, i have not problem to do pdf printing under koffice and kate... the problem seem to appear only under konqueror...
Comment 7 Cristian Tibirna 2005-10-18 06:17:25 UTC
On 17 October 2005 23:43, Marc Collin wrote:
> ------- other information, i have not problem to do pdf printing under
> koffice and kate... the problem seem to appear only under konqueror...


It only depends on the contents of the PS generated by Qt from what you want 
to print. Often it's a matter of a small image that, if removed, makes the 
problem go away. So, it is to be expected that the problem you see doesn't 
occur with all KDE applications.
Comment 8 Alex Cherepanov 2005-12-07 03:02:13 UTC
KDE hacking and Ghostscript hacking are different skills. The latter starts with a PostScript file. Please retrieve the PostScript file your box generates and submit it here.
Comment 9 Dima Ryazanov 2006-03-03 03:13:45 UTC
Created attachment 14929 [details]
Testcase for gs crash

Here's a testcase.

And that's definitely not a KDE bug...

With gs version 8.15.1, I get:

dima ~ $ gs -q -dSAFER -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
-sOutputFile=slashdot.pdf -sPAPERSIZE=a4  -c .setpdfwrite -f slashdot.ps
Segmentation fault (core dumped)
Comment 10 Kurt Pfeifle 2007-01-13 01:11:30 UTC
OK, closing as INVALID now.


Last advice (for this thread) to Marc Collin: Try setting the "compatibility level" in the printer properties of the PDF printer to "1.2". This does help sometimes....

Cheers,
Kurt
Comment 11 Kurt Pfeifle 2007-01-13 01:21:25 UTC
Mine is ESP Ghostscript 8.15.0. I'm using the very same file, but renamed to "crash.ps":

kurt@soprano:~> gs -dSAFER -dPARANOIDSAFER -dNOPAUSE -dBATCH \
                   -sDEVICE=pdfwrite \
                   -sOutputFile=crash.pdf \
                   -sPAPERSIZE=a4 \
                   -c .setpdfwrite \
                   -f crash.ps
ESP Ghostscript 8.15 (2004-09-22)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.

I'll upload the resulting crash.pdf file.
This software comes with NO WARRANTY: see the file COPYING for details.
Segmentation fault

kurt@soprano:~> gs -dSAFER -dPARANOIDSAFER -dNOPAUSE -dBATCH \
                   -sDEVICE=pdfwrite \
                   -sOutputFile=crash.pdf \
                   -sPAPERSIZE=a4 \
                   -dCompatibilityLevel=1.2 \
                   -c .setpdfwrite \
                   -f crash.ps
ESP Ghostscript 8.15 (2004-09-22)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file COPYING for details.


Comment 12 Kurt Pfeifle 2007-01-13 01:23:23 UTC
Note, the default compatibility level for most distro's ps2pdf setup is 1.3.
Comment 13 Kurt Pfeifle 2007-01-13 01:26:26 UTC
Created attachment 19263 [details]
PDF generated with Ghostscript's "compatibility level" option set to 1.2


PDF generated by Ghostscript from the "slashdot.ps" using
"-dCompatibilityLevel=1.2" parameter.

Ghostscript segfaults if default "1.3" is used.