Displaying PDF files in FileMaker

Displaying frequently referenced PDF files in a web viewer is convenient for users and adds depth and interactivity to a layout. This article includes a simple step-by-step guide for displaying PDFs in FileMaker, as well as a backend look at why this works.


GIF showing interactive PDFs in a web viewer
Interactive PDF in a container field

To display PDFs:

  1. Add a container field to the layout
  2. Go to layout mode
  3. Select the container field then go to the “Data” tab in the inspector and select “Interactive content”
Interactive content setting for container fields

You should now be able to see PDF files in interactive container fields in FileMaker Pro, FileMaker Go and WebDirect. I prefer to use the “Insert File” script step because I can customize its dialog box to have a consistent behavior for users. For example, I can set it to only allow certain files to be uploaded to the container field, and to always display the content of the file when possible. Make sure to select “Content of file” to display the contents of PDF files in interactive container fields.

Options available for the "Insert File" script step
Insert File script step

Caveats:

  • Selecting “Optimize for Images” will only render the first page of the PDF file
  • If you’re having problems opening the PDF file check out this blog
  • Hosted solutions must have a valid SSL certificate. Getting “The webpage cannot be found” is often caused by not having a valid SSL certificate on both the web server and the FileMaker Server.
  • Use SNI on the web server if you’re using an SSL certificate on the web server that’s different than the one installed on the FileMaker server. This is often the case in large WANs. By “web server,” I’m referring to the web server of the FileMaker server, which is Apache for MacOs and IIS for Windows.
  • Storing files as references is a recipe for disaster. For wisdom about container fields, check out our videos about them: part 1 and part 2
  • For internal networks, install an SSL certificate on FileMaker Server and add a DNS record in order to get a valid SSL connection to the server from the client (fms.mycompany.com –> 192.168.1.10)
Popup seen when SSL certificate isn't valid
Screen if SSL certificate is not valid

Under the hood:

The FileMaker server streams the PDF files to the container field. The container field opens https://[your domain]:16000/Streaming_SSL/… to display the PDF file in the interactive viewer.

Interactive containers are rendered using the web browser technologies that web viewer uses.

FileMaker Glossary (source)
Backend web viewer technology that allows interactive content to be displayed in a container field
Notice the URL at the bottom

Cool things you can do with PDF files in FileMaker (including WebDirect):

  • Export layouts as PDF (e.g. sales reports)
  • Interact with PDF files within FileMaker
  • Convert PDF files to HTML using Javascript in a web viewer
  • Convert any Word, Excel or Powerpoint file to PDF without a FileMaker plugin (click here for more info)
  • Append pages to existing PDF files
  • Use OCR with scanned documents through FileMaker to create PDF files with selectable text

Let us know in the comments if you’re interested in an in-depth guide on any of the above.