简体   繁体   中英

Convert pdf to jpg using ImageMagick without Ghostscript

I'm trying to convert pdf to jpg using ImageMagick php. It seems that ImageMagick needs Ghostscript to work with pdfs however my shared hosting provider does not allow the installation of Ghostscript since it makes use of shell_exec() and exec() .

So my question is. Can I convert pdf to jpg with ImageMagick without Ghostscript. If not is there an alternative. I'm doing this using the wordpress platform fyi.

PDF is not a raster image format it is a special language to describe an image. So to convert it to the raster format you need a RIP (Raster image processor) .

ImageMagick uses GhsotScript for that. So you can't do it with ImageMagick without GhostScript. You can use GhostScript to render PDF to JPG from command line running gswin32.exe ( even without ImageMagic ) or from your software using gsdll32.dll.

Also another way is to use Adobe ActiveX component from your software. Usually it is already installed on Windows with Adobe Acrobat.

Here is a good explanation and many ways to render PDF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM