convert pdf to png doesn't work complete

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
brush51

convert pdf to png doesn't work complete

Post by brush51 »

Hi folks,

i have a little problem mit imagemagick(version 6.5.5-10) on a Debian Server.
I am root on this server.
I want to convert a PDF to PNG with the following commands:

Code: Select all

convert -scale 100x100 "test.pdf[0]"  output.png

convert test.pdf -density 600x600 -resize 800x560 PNG:'output.png'
The conversion doesn't work correctly. The output.png is not an png. I have checked the header of this file and it is a pdf with the ending of .png.
But i want a original png. Can someone help me?

greets,
brush51
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert pdf to png doesn't work complete

Post by magick »

Type
  • convert -list format
If the PNG format is supported, you get a PNG with a mode of rw-. If its not there, ImageMagick was built without ImageMagick support. To fix download and install the PNG library. Also be sure you have the PNG header files (e.g. png.h). When you configure ImageMagick it tells you whether it validates a particular delegate library. Be sure it does not complain about PNG. Now rebuild ImageMagick and reinstall. Now your PDF to PNG conversion should work as expected.
brush51

Re: convert pdf to png doesn't work complete

Post by brush51 »

Hello magick,

yes you're right. I have installed the libpng and after that reinstalled imagemagick.
convert works now! :)

thanks a lot!

brush51
brush51

Re: convert pdf to png doesn't work complete

Post by brush51 »

Now i have a new problem with several pdf's.

i get this error:

Code: Select all

Error: /invalidfont in /findfont
Operand stack:
   --dict:9/18(L)--   F1   72   --dict:9/9(L)--   --dict:9/9(L)--   Arial   Arial
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1889   1   3   %oparray_pop   1888   1   3   %oparray_pop   1872   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   1847   7   9   %oparray_pop
Dictionary stack:
--dict:1152/1684(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:274/300(ro)(G)-- --dict:21/25(L)-- --dict:4/6(L)-- --dict:24/31(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.60: Unrecoverable error, exit code 1
convert: Postscript delegate failed `arial.pdf': Datei oder Verzeichnis nicht gefunden @ pdf.c/ReadPDFImage/630.
convert: missing an image filename `ausgabe.png' @ convert.c/ConvertImageCommand/2819.
[/code]

I dont really understand this error. convert cant find the font arial, but the error comes from ghostscript? right?

thanks a lot for helping

brush51
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert pdf to png doesn't work complete

Post by fmw42 »

not sure but perhaps you need to install freetype as well as ghostscript.
brush51

Re: convert pdf to png doesn't work complete

Post by brush51 »

i have installed ghostscript and i moved a downloaded fontpackage into the font-folder from ghostscript.
it works now.
Post Reply