Search code examples
phpconvertersghostscriptimagemagick-convert

Ghostscript convert files from external url


I am trying to convert an external file (e.g http://url.com/file.ext) using Ghostscript and PHP. It always says undefined filename but if I change the url to my server/local url it works. Is it really possible to convert external file?

"C:/Program Files/gs/gs9.14/bin/gswin32.exe" -sDEVICE=tiffg4 -sPAPERSIZE=legal -dBATCH -sOutputFile="C:/Users/user/Desktop/test.tiff" -dNOPAUSE -dBATCH -dSAFER "http://url.com/file.ext"

Solution

  • Ghostscript doesn't include any browser code. In order to open files i uses the operating system API. If your OS supports opening URLs by using fopen() then it will work, if not, it won't.