You are not logged in.

#1 2012-01-29 00:59:51

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

ImageMagick fails to convert a PDF file (GhostScript can't find file?)

I was trying to convert a .pdf file into a .png file with imagemagick (here is the sample pdf file: http://ompldr.org/vY2ljcg ).

However, apparently ImageMagick already failed simply opening the file:

$ convert main.pdf main.png
Unrecoverable error: rangecheck in .putdeviceprops
sfopen: gs_parse_file_name failed.
  ./base/gsicc_manage.c:866: gsicc_open_search(): Could not find lab.icc 
| ./psi/zusparam.c:856: set_lab_icc(): cannot find default lab icc profile
convert: Postscript delegate failed `main.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/665.
convert: missing an image filename `main.png' @ error/convert.c/ConvertImageCommand/3016.

Any ideas?

Offline

#2 2012-01-29 07:01:36

redguardtoo
Member
From: China, Shanghai
Registered: 2007-11-28
Posts: 43
Website

Re: ImageMagick fails to convert a PDF file (GhostScript can't find file?)

try pdftoppm in poppler. then convert the ppm to png.

ImageMagic use ghostscript, ghostscript is not as error tolerant as poppler.

Last edited by redguardtoo (2012-01-29 07:02:13)


Help me, Help you
Intel(R) Core(TM) i3 + 3G + GeForce GST 250
Archlinux+musca+tint2+netcfg

Offline

#3 2012-01-29 19:47:55

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: ImageMagick fails to convert a PDF file (GhostScript can't find file?)

Thanks, that of course is one solution. I could also just use pdfdraw from mupdf, which would work.

I am quite surprised still that ghostscript seems to have some problems there, which is a shame, because ImageMagick's other functions are quite useful.

I am not tagging this [solved] quite yet, because in fact the problem still persists. Maybe somebody else has an idea.

Offline

#4 2012-01-30 05:44:28

redguardtoo
Member
From: China, Shanghai
Registered: 2007-11-28
Posts: 43
Website

Re: ImageMagick fails to convert a PDF file (GhostScript can't find file?)

put it this way. if all PDF creator produces only standard PDF, then ghostscript is fine. But most PDF creator don't (except Adobe Acrobat). So a compatible pdf reader need handle non-standard PDFs. It's a long-term boring maintaining job which need much human resource.

My impression is poppler's community is the most active one which means it has more volunteers to fix bugs.

I am familiar with all the open sourced PDF engines because I did PDF application for 3 years.

Last edited by redguardtoo (2012-01-30 06:04:58)


Help me, Help you
Intel(R) Core(TM) i3 + 3G + GeForce GST 250
Archlinux+musca+tint2+netcfg

Offline

#5 2012-02-27 03:57:15

lajos
Member
Registered: 2010-08-12
Posts: 5

Re: ImageMagick fails to convert a PDF file (GhostScript can't find file?)

redguardtoo wrote:

poppler's community is the most active one which means it has more volunteers to fix bugs

Thanks so much for the poppler suggestion! It works perfectly. I had the same issue with imagemagick as OP.

pdftoppm can even output png files with the -png option (other formats are also supported, look an the man page).

Offline

#6 2014-08-30 23:00:46

hepha
Member
Registered: 2012-07-20
Posts: 13

Re: ImageMagick fails to convert a PDF file (GhostScript can't find file?)

I have this error installed ghostscript-git to normal for your reference

sfopen: gs_parse_file_name failed.
  ./base/gsicc_manage.c:1050: gsicc_open_search(): Could not find `
| ./base/gsicc_manage.c:1651: gsicc_set_device_profile(): cannot find device profile

Offline

Board footer

Powered by FluxBB