“[Er, Almost] Always Working” FileMaker app Multi-Page PDF viewer

Note: This technique should be considered “almost always working”, not “always working” as previously (and wishfully) billed. Sorry, as FileMaker and desktop OSes have changed, this file, which relies on several technologies from several different sources working together, has proven to be not always reliable. I would not try to use it in any solution you need to depend on. Feel free to ask, but I can’t promise to provide support for free downloads, you may be on your own.  Please read the disclaimer section at bottom before downloading.

I’ve recently encountered a couple of situations where FileMaker was unable to correctly display a PDF in an interactive container field. There’s a whole slew of technical reasons why this might happen — they might have been inserted using “Insert File…” instead of “Insert PDF…”, it could be an issue with system PDF software on the machine they were inserted on or the machine they’re being viewed on, it could be an issue with the server’s SSL, the list goes on and on. Even if you display PDFs in a Web Viewer using a Data URL or local file reference, you are still dependent on a client machine’s PDF capabilities, outside of FileMaker, and it isn’t always pretty.

I whipped up this quick demo to show how to reliably display multi-page PDFs to the user on a FileMaker Pro layout, regardless of any technical issues. It uses a web viewer and Mozilla’s PDF.js javascript library to display all pages of a PDF using standard HTML5 Canvas elements. It’s a very bare-bones demo right now, I’ll come back and flesh it out at some point.

Notes and disclaimers, please read before downloading:

FM 18+: I’ve gotten a report of this file crashing the FileMaker app completely in FM 18 on Windows. You’ve been warned.

FM 17+: This technique works perfectly without any workarounds in FileMaker 16. There is a Web Viewer bug in FM17 (at least on Mac OS X, where I tested it) which requires a very short script to run once when a file opens, in order for certain javascript features to work properly. Please see the “FM17 Bug Info” tab if you implement this technique in a file to be used with FileMaker 17 or later, at least until the bug is fixed. Detailed info is on the bug report at https://community.filemaker.com/message/804617. That thread also contains a second workaround courtesy of Sam Oda that helps with this and other documented web viewer bugs.

FM 13-15: Thanks also to one Peter Barfield who pointed out to me that the technique I originally used did not work in FileMaker 15 or lower. As of December 2019 I’ve updated the file so it works in FileMaker versions 13-15 now.

WebDirect (any FM version):  There have been some problems reported by intrepid souls trying to use it in a WebDirect layout.

My free downloads are offered as-is and without warranty. At this time, all I can offer anyone stymied by any of the above or other issues is a complete and immediate refund of their purchase price. (I’m being cute. Sorry if it doesn’t work for you. I’ll come back to it as I have time and see if I can improve it.)

Download link:

AlwaysWorkingPDFviewer.fmp12 (If WordPress is wonky, you might have to right-click and “Save linked file as…”).

FileMaker Pro Web Viewer-based PDF Viewer screenshot

“Always Working” multi-page PDF viewer screenshot


Related articles

  • Michael Kupietz
  • Certified Expert FileMaker Pro Consultant & Full-Stack Web Developer
  • Serving clients locally and remotely, in California's San Francisco Bay Area and nationwide
  • Phone: (415) 545-8743
  • Download vCard