Software tips, techniques, and news.

By Brendan McBride  Posted on  August 12th, 2014  in  Free Downloads, FileMaker, Hosting

How to Create a PDF from FileMaker Server

PDF and FileMaker Server iconsHave you ever wanted to email customers their invoices automatically? Have you ever wanted to generate and email a report to your employees every morning? Have you ever just wanted to create a PDF from FileMaker Server? If you have answered yes to any of these questions, congratulations, you have come to the right place! Currently FileMaker Server does not support the creation of PDFs natively; however, if you have PHP enabled for your database, you can create a PDF from the server.

What Is Needed

First, you will need to download a PHP library that will allow you to create a PDF using PHP. I recommend using the Free PDF library as this article will assume you are using the FPDF library. Once you have downloaded FPDF and placed it within your web server, you will then need to create your report using PHP and the FPDF library.

Creating The PDF Using PHP

PHP PDF coding exampleThe next step is to write the PHP script that will create the PDF and output it back to FileMaker as a PDF. Because PHP is creating the entire PDF, all the business logic to create the report will need to be within PHP. You will need to use Custom Web Publishing to bring in any data that you may want within the report that is in your FileMaker database.

As you gather your data from FileMaker, you will build your PDF by setting the X and Y coordinates and the font of each object in the PDF. Check out the FPDF tutorial page for a quick tutorial on building PDFs with PHP to get a better understanding on how to use this library to its full potential. Once you are finished building the report, you will use the FPDF Output() function to output the PDF as a file back to FileMaker.

Saving The PDF From Server

The final step is to write a server-side script in FileMaker that will run the report. Use the Insert from URL script step to call the PHP script. The URL needs to be the web address of the PHP script. The Insert from URL script step will enter the content of your PHP file, which is a PDF, into a specified container field. Now you have everything you need in order to create a PDF using FileMaker Server.

Conclusion

Using PHP to build a PDF is a great way to automatically create and email PDFs from FileMaker Server. Feel free to download our example FileMaker database and PHP files and watch our YouTube video tutorial above so you can try this technique yourself. Or contact us and we would be happy to assist anyone looking to create PDFs from their FileMaker Server.

Did you know we are an authorized reseller for FileMaker Licensing?
Contact us to discuss upgrading your FileMaker software.

Download
Download the How to Create a PDF from FileMaker Server File
Please complete the form below to download your FREE FileMaker file.
FileMaker Experience *
Terms of Use *
OPT-IN: I agree that I am downloading a completely free FileMaker application file with no strings attached. This file is unlocked, and I may use it for my business or organization as I see fit. Because I am downloading a free file, I agree that I should receive occasional marketing. I understand that I can OPT-OUT of these emails at anytime.
Brendan McBride thumbnail
Brendan McBride

Brendan is a certified FileMaker and web developer and is a very friendly, hard-working, and technically-astute engineer ready to solve any problem you throw at him. Brendan went to Purdue, receiving a Bachelors in Computer Science and minored in Economics.

FileMaker 18 Certified Developer
FileMaker 17 Certified Developer
FileMaker 16 Certified Developer
FileMaker 15 Certified Developer
FileMaker 14 Certified Developer
FileMaker 13 Certified Developer
FileMaker 12 Certified Developer
FileMaker 11 Certified Developer
"We were actually able to add more features than we thought would be possible within our budget. We always experienced a ‘can do’ attitude and DB Services was incredibly patient and easy to work with."
Courtney Hartman
Art Director
"The new FileMaker custom website interface is very user-friendly and easy to follow for our clients. In addition, it is much faster than the old Instant Web Publishing (IWP) interface. Thank you and all the others who have helped us out at DB Services. I am very grateful for the excellent service you provide us. Its nice to know we can call you for help if we have an issue."
Wayne Capek
President
"We needed a solution that would simplify the administration of our responsibilities under our contract with the State of Indiana. We have seen a dramatic increase across the state in the number of potential foster and adoptive parents that have begun the preparation and training process. This increase has resulted in a significant opportunity for children available for adoption. That’s a big win for everyone! And it’s all because we can refer potential parents to the proper state contacts efficiently and quickly."
Chris Morrison
Executive Director
"Thank you for all of your expertise and valuable help. I am so grateful to have found DB Services."
Linda Findlay
Owner
"Thank you for our new database system. We transitioned from a carbon copy paper based system to a digital database. The software has saved us time and money. We used to archive all our jobs in cabinets, now we can look up a job in seconds from anywhere. The software allows us to easily email estimates to our customers in pdf format. In a year there was a return on investment just from eliminating the purchasing of our carbon forms."
Todd Cartmel
Owner
"The new system allows us to create and track jobs for customers along with inventory, something we had been doing with separate word and spreadsheet files. Because it’s now so intuitive, new staff members are able to begin using the database immediately without our usual training session and ‘cheat sheets’ for getting around within the file."
Tom Andrews
President