Error “Invalid Parameter” fom ImageMagick convert on Windows

后端 未结 6 2156
我在风中等你
我在风中等你 2020-12-30 23:39

I am trying to convert a PDF document into a PNG file using ImageMagick command line tools from a ASP.NET website. I create a new shell process and ahve it execute the follo

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 00:23

    convert is also the name of a windows executable which converts FAT filesystem to NTFS. When you do not specify the full path of an executable, quote:

    ...the system first searches the current working directory and then searches the path environment variable, examining each directory from left to right, looking for an executable filename that matches the command name given.

    "C:\Windows\System32" is generally present in the beginning of %PATH% variable, causing the Windows convert utility to launch, which fails with "Invalid Parameter" error as expected.

    Try specifying the full path of the ImageMagick's convert.exe like so:

    "C:\Program Files\ImageMagick\convert.exe" -density 96x96 "path_and_filename.pdf" "path_and_filename.png"
    

提交回复
热议问题