Product Logo

CNS Image

Import, edit, and export Images in the FileMaker environment


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.

Note, the plug-in cannot write the PDF format, only read it. This means you can convert from a PDF to another supported format, but you cannot convert to a PDF. This also means you cannot do other manipulations to a PDF such as resizing, rotating, and etc. You will first need to convert the PDF to another format such as a JPG, and then you can manipulate that format.

##Download Ghostscript Ghostscript is freely available to download, however licensing restrictions prevent us from distributing it with the plug-in.

Windows
https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/gs920w32.exe

Mac
http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-8.71-macosx.tar.gz

There may be newer versions of Ghostscript available. To find the latest version available or to download a 64bit Windows version, visit https://ghostscript.com/download/gsdnld.html.

##Install Ghostscript 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 Windows
Double-click the .exe file you downloaded in the previous step and follow the installation wizard.

Figure 1 Windows Installation Wizard

Mac

  1. If not already expanded, double-click the file you downloaded to expand it. You should then have a folder that resembles Figure 2.
Figure 2 Decompressed Ghostscript Folder
  1. Find the "gs-8.71-macosx" file in the folder. Note, if you download a different version of Ghostscript, the filename may vary.
  2. Rename the file to "gs"
  3. Copy the "gs" file to your Applications folder. Your Applications folder should resemble Figure 3.
Figure 3 Ghostscript Installed

###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:

Windows
C:\Program Files\gs\gsX.XX\bin\gswin32c.exe The X.XX represents the version number, and CNS Image will always look for the latest version.

Mac
/Applications/gs
or
/usr/local/bin/gs

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.