Page 1 of 1

An error occurred while reading an XREF table

Posted: 2011-05-23T07:29:29-07:00
by gajendrabang
Hi,

I am getting this problelm while converting pdf to png using phmagick on linux. I am using phMagick to convert pdf to png. Version of imagemagick on linux server is
Version: ImageMagick 6.4.8 2010-03-18 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Moreover when I try to convert this pdf on my windows xp, it works very well. Version on my xp machine is
Version: ImageMagick 6.6.4-2 2010-09-14 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
the file size is only 287 kb

Code: Select all

phMagick: Error executing "/usr/bin/convert -density 200 -quality 100 -scene 1 "/home/digikat/public_html/varensbocker.se/sample-books/sample-9789173271516.pdf" "/home/digikat/public_html/varensbocker.se/flip-book/pages/9789173271516/%d.png""
return code: 1
command output :" **** Warning: An error occurred while reading an XREF table.
**** The file has been damaged. This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.
ERROR: /undefined in /BXlevel
Operand stack:
240 0 1 --dict:6/6(ro)(G)-- obj
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-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval--
Dictionary stack:
--dict:1126/1686(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- --dict:107/200(L)-- --dict:104/127(ro)(G)-- --dict:241/347(ro)(G)-- --dict:18/24(L)--
Current allocation mode is local
ESP Ghostscript 815.02: Unrecoverable error, exit code 1
convert: Postscript delegate failed `/home/digikat/public_html/varensbocker.se/sample-books/sample-9789173271516.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `/home/digikat/public_html/varensbocker.se/flip-book/pages/9789173271516/%d.png' @ convert.c/ConvertImageCommand/2756."
Notice: exception 'phMagickException' in /home/digikat/public_html/varensbocker.se/phmagick/phmagick.php:192 Stack trace: #0 /home/digikat/public_html/varensbocker.se/phmagick/plugins/convert.php(37): phmagick->execute('/usr/bin/conver...') #1 /home/digikat/public_html/varensbocker.se/phmagick/phmagick.php(208): phMagick_convert->convert(Object(phmagick)) #2 [internal function]: phmagick->__call(Array, Array) #3 /home/digikat/public_html/varensbocker.se/pdf-to-image.php(44): phmagick->convert('convert', Array) #4 {main} in /home/digikat/public_html/varensbocker.se/phmagick/phmagick.php on line 192

Array
(
    [0] => Array
        (
            [cmd] => /usr/bin/convert -density 200 -quality 100 -scene 1 "/home/digikat/public_html/varensbocker.se/sample-books/sample-9789173271516.pdf"  "/home/digikat/public_html/varensbocker.se/flip-book/pages/9789173271516/%d.png"
            [return] => 1
            [output] => Array
                (
                    [0] =>    **** Warning:  An error occurred while reading an XREF table.
                    [1] =>    **** The file has been damaged.  This may have been caused
                    [2] =>    **** by a problem while converting or transfering the file.
                    [3] =>    **** Ghostscript will attempt to recover the data.
                    [4] => ERROR: /undefined in /BXlevel
                    [5] => Operand stack:
                    [6] =>    240   0   1   --dict:6/6(ro)(G)--   obj
                    [7] => Execution stack:
                    [8] =>    %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--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--
                    [9] => Dictionary stack:
                    [10] =>    --dict:1126/1686(ro)(G)--   --dict:0/20(G)--   --dict:107/200(L)--   --dict:107/200(L)--   --dict:104/127(ro)(G)--   --dict:241/347(ro)(G)--   --dict:18/24(L)--
                    [11] => Current allocation mode is local
                    [12] => ESP Ghostscript 815.02: Unrecoverable error, exit code 1
                    [13] => convert: Postscript delegate failed `/home/digikat/public_html/varensbocker.se/sample-books/sample-9789173271516.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
                    [14] => convert: missing an image filename `/home/digikat/public_html/varensbocker.se/flip-book/pages/9789173271516/%d.png' @ convert.c/ConvertImageCommand/2756.
                )

        )

)