Client Side PDF Forms

PDFs have become the digital equivalent of what was once printed on paper and will likely remain in use for a long time. They offer an easy way to present structured information, and FileMaker simplifies PDF generation by allowing you to save your layout's design as a PDF.

However, there are times when simply exporting FileMaker data to a PDF isn't enough — you may need to populate an existing PDF with data. The challenge can be getting your FileMaker data into a copy of the PDF. While there are external tools and plugins that help with this, there have been few native client-side solutions until recent years. To make this possible, we can leverage FileMaker's Web Viewer and its integration with a JavaScript library.

In this video, I'll show you how to populate a form-fillable PDF with data from your FileMaker solution using a Web Viewer, a JavaScript library, custom code, and any existing PDF form. Once you understand the basics of how a PDF reports its fields and types, inserting data into a PDF becomes straightforward. Mastering this integration will give you the ability to work with your own PDFs, and in some cases, you may find that creating a fillable PDF template is more efficient than exporting a PDF directly from a FileMaker layout.

AttachmentSize
ClientSidePDFForms.zip2.64 MB
Tags:
PDF

Comments

This code works great as far as it goes, but there is a gotcha in some cases. If the resulting PDF is going to be sent electronically to a recipient it should be "flattened" before sending. This is because the form returned by pdf-lib is still fillable and therefore can be further edited. This could create a security concern. Fortunately pdf-lib provides a function which will take the filled-in form as input and return one which is not fillable. The pdf-lib function is named "flattenPdfForm". Just a heads-up.

Paul Davis
Ultra Golden Software LLC