Created attachment 23437 [details]
PDF file from which pdftops produces broken PostScript
The PostScript which comes out when converting the attached PDF file via
is broken. Ghostscript 8.64 gives the following error:
till@till-laptop:~/ghostscript/gpl/testfiles$ gs afdruk.ps
GPL Ghostscript 8.64 (2009-02-03)
Copyright (C) 2009 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /syntaxerror in -file-
--nostringval-- --nostringval-- --nostringval-- 19
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
--dict:1147/1684(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)-- --dict:87/150(L)--
Current allocation mode is local
Current file position is 257319
GPL Ghostscript 8.64: Unrecoverable error, exit code 1
till@till-laptop:~/ghostscript/gpl/testfiles$ pdftops --version
Error: Couldn't open file '--version'
till@till-laptop:~/ghostscript/gpl/testfiles$ pdftops -version
Error: Couldn't open file '-version'
Version of pdftops:
pdftops version 0.10.3
Copyright 2005-2009 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2004 Glyph & Cog, LLC
Usage: pdftops [options] <PDF-file> [<PS-file>]
Problem was observed on Ubuntu Intrepid and Jaunty. Original bug report:
Created attachment 26437 [details] [review]
Patch to fix this bug
I have found the cause of the problem. ASCII85-encoded binary data was not correctly copied from the PDF input file. Patch attached.
It seems i already commited that patch in master as part of other bugfix, can you confirm git master is ok? The attached document seems to work.
I do not have the GIT repo of Poppler handy here, but if you have checked that the attached file is correctly converted (result displays with Ghostscript or prints on PS printer when sending unfiltered) it is OK and you can mark the bug as fixed. You can also check the poppler/PSOutputDev.cc file whether my two insertions are actually there.
I have checked in the web interface of the GIT repo now. There is only one of my insertions, the one where the array gets actually written. This fixes the bug but the array will be created one unit too big. In my patch I do the same insertion also in the pre-calculation of the array size. See my patch and compare with
Right, i did not check correctly and was misled by a similar check in the above line.