I have written a dll that utilizes the C++ API to manipulate tiff images. I now want to be able to handle pdf images as well, but have trouble understanding how to include Ghostscript with my project. Is there some examples that show how to set up and use ghostscript with the GraphicsMagick API to process pdf files? Download and build the source, then import into my project?
You didn't say what operating system you are using. Under Windows (or if using libgs under Linux) Ghostscript gets loaded and executed as a DLL/shared-library into GraphicsMagick and if your application links to GraphicsMagick, into your application as well. In this case it is necessary for the GraphicsMagick build architecture and Ghostscript build architecture to match (e.g. 32-bits). Under Windows, GraphicsMagick uses the Windows registry to find where Ghostscript is installed.
Normally one installs a pre-built Ghostscript package and the Ghostscript fonts and GraphicsMagick will invoke Ghostscript (as an executable) whenever it is told to read a PDF file. Except for the case where the Ghostscript DLL/shared-library is used, it is only necessary for the Ghostscript executable to be in your executable search path, or for the location of it to be remembered in the installed delegates.mgk file.
Thank you for the quick response. I am using Windows and including GM dlls with my application in the same directory. So I assume that I will need to do the same with the Ghostscript dlls. Is that correct?
Ghostscript is a rather picky program. I think that it will need to be installed using its own installer. Ghostscript provides many of its own components which it needs to find at run time. It is not as simple as just putting some DLLs in the same directory as GraphicsMagick.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.