Working with PDF Files
CNS Image alone cannot read PDF files but has the ability to work with a command line program called Ghostscript, which enables this functionality. If you need to Import or Convert From PDF files, you will need to install Ghostscript. If you do not need to Import or Convert From PDF files, installing Ghostscript is not necessary.
Ghostscript is freely available to download, however licensing restrictions prevent us from distributing it with the plug-in.
https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/gs920w32.exe There may be newer versions of Ghostscript available for Windows. To find the latest version available or to download a 64bit Windows version, visit https://ghostscript.com/download/gsdnld.html.
https://pages.uoregon.edu/koch/ has several different versions available. Choose one that best matches your operating system.
Installation of Ghostscript varies depending on your operating system and whether you want to install it on just one computer or distribute it to multiple computers.
Single Computer Installation
Double-click the .exe file you downloaded in the previous step and follow the installation wizard.
- If not already expanded, double-click the file you downloaded to expand it. You should then have a folder that resembles Figure 2.
- Find the "gs-8.71-macosx" file in the folder. Note, if you download a different version of Ghostscript, the filename may vary.
- Rename the file to "gs"
- Copy the "gs" file to your Applications folder. Your Applications folder should resemble Figure 3.
###Multiple Computer Installation Please see the Ghostscript Scripted Install example database for more information.
##Link Ghostscript to CNS Image In order for CNS Image to use Ghostscirpt, it must know where Ghostscript is installed. By default CNS Image looks for it in the following locations:
The X.XX represents the version number, and CNS Image will always look for the latest version.
If you installed Ghostscript in a different location, you will need to use the CNSImage_SetGSPath function to tell CNS Image where to find Ghostscript. For example:
CNSImage_SetGSPath( “file:/Users/Bob/Documents/GS” )
CNSImage_SetGSPath( “file:/C:/My Documents/gs/gs9.02/bin/gswin32c.exe” )
Note, on Windows, make sure to use the path to the “gswin32c.exe” file and not “gswin32.exe”. The “c” in the filename represents “command line”, which is the file CNS Image requires.
Providing CNS Image with the path to Ghostscript is session based, so when FileMaker is restarted, the plug-in will not retain the location of Ghostscript. It is a good idea to add logic to the startup script of your database to check for the existence of Ghostscript and tell the plug-in where it is located. Again, the plug-in looks in the default locations above for Ghostscript, so you only need to use CNSImage_SetGSPath if you install it in a non-default location.