Bug 689137 - converting attached PDF to 1.3 malfunctions
Summary: converting attached PDF to 1.3 malfunctions
Status: RESOLVED DUPLICATE of bug 689805
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 8.54
Hardware: Macintosh other
: P4 normal
Assignee: Ken Sharp
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2007-03-13 07:31 UTC by lazer100
Modified: 2009-08-19 01:54 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
a pdf file which cannot be converted to 1.3 by AFPL Ghostscript 8.54 (260.45 KB, application/octet-stream)
2007-03-13 07:33 UTC, lazer100
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lazer100 2007-03-13 07:31:31 UTC
attempting to convert the attached PDF to 1.3 via ps2pdf13 malfunctions
with error messages:

Error: /VMerror in --.pushpdf14devicefilter--
VM status: 3 1423361 2721528
Current allocation mode is local
Last OS error: 2
AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
Comment 1 lazer100 2007-03-13 07:33:22 UTC
Created attachment 2835 [details]
a pdf file which cannot be converted to 1.3 by AFPL Ghostscript 8.54
Comment 2 Hin-Tak Leung 2007-03-17 09:18:19 UTC
ps2pdf and pdf2pdf13 both works fine without error and the two generated pdf 
seems valid, but ps2pdf (which in this case generates pdf 1.4) is a lot faster.
(1) do you really mean pdf 1.3?
(2) the spec of your machine running ghostscript? VMerrors sometimes are
due to limited resources on under-powered machines. (I ran your pdf file
on an opteron with 1GB memory).
Comment 3 leonardo 2007-03-18 09:25:40 UTC
A conversion to PDF 1.3 needs to convert transparncy into bitmap. It may need 
to allocate a whole page raster buffer - 
3*HWResolution.x*HWResolution.y*Width*Height (in inches) - it's a pretty big 
walue. Ensure you comp is capable of that. Specify a slapper resolution with -r 
instead the default 600 dpi. We're sorry for this poor architectural solution 
in Ghostscript. We're got plans for improving it with inserting a banding 
buffer between the interpreter and pdfwrite device.
Comment 4 leonardo 2007-03-18 09:26:49 UTC
s/slapper/smaller
Comment 5 lazer100 2007-03-18 15:37:28 UTC
ok, lack of memory is probably the explanation then.

I've tried it now on a bigger amount of memory, 512M,
previously it was on 128M,

the conversion uses at least 380MB and now crashes with a totally different
message, so it is probably now running out of memory elsewhere,


the error messages now are:

Error: /rangecheck in --.discardtransparencygroup--
Operand stack:
   --dict:6/6(L)--   1   false   --dict:10/14(L)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   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--   2116   --nostringval--   3   12   %oparray_pop   --nostringval--   false   1   %stopped_push   3   12   %oparray_pop   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1120/1686(ro)(G)--   --dict:2/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:105/127(ro)(G)--   --dict:253/347(ro)(G)--   --dict:21/24(L)--   --dict:4/6(L)--   --dict:20/20(L)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:2/5(L)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:9/17(L)--
Current allocation mode is local
Last OS error: No such file or directory
AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
 

is there any trick way around the problem?

can I convert it in 2 stages in a way that bypasses the memory constraint?

unfortunately I dont have access to a 1G machine and using OS VM will
probably be much too slow,

Comment 6 lazer100 2007-03-18 15:43:09 UTC
SUCCESS!

I put -r200 twice and now no errors!

Comment 7 lazer100 2007-03-19 06:16:42 UTC
how feasible would it be to _optionally_ expand the bitmap to a 
file instead of to memory?

because then say 10Gig even would be no problem
and you can retain the current algorithm,

that way people can go via memory and if that fails give a 
command line arg like: -sUseBitMapFile=/x/y/z

the user needs to specify the temporary file as the user will
know which volume has enough space, ideally an empty volume
entirely for this purpose,
Comment 8 leonardo 2007-08-29 20:13:09 UTC
Passing to Ken since he handles pdfwrite from now.
Comment 9 Ken Sharp 2009-08-19 01:54:33 UTC

*** This bug has been marked as a duplicate of 689805 ***