I've been successfully using Matt Petrowsky's "blazing fast" method for merging PDFs successfully. (Thanks, Matt, for this terrific tool!!!)
But I ran into a problem that took a little head scratching to solve ... So I thought I'd share the solution in case anyone else encounters the same issue.
Matt's solution involves a ScriptMaster function called "catpdf" (relies on the ScriptMaster plug-in from 360Works). Lately some PDF files cause an error that stops the merge from completing.
Based on Matt's demo database (from FileMaker Magazine), I'm been using version 2.1.3 of the iText JAR that this ScriptMaster function requires. But the latest version of iText is identified as "5.3.5". I started wondering if perhaps the much older version if iText was having problems with some recent additions to the structure of PDF files. A lot of water has gone under the bridge since Matt first released his solution ... back in the FileMaker 9 days.
So I downloaded the newest "released" version of the iText library. You can get it here:
Note: You don't need the "extrajars" file.
And then you'll need to make a minor change to 4 lines of code inthe function itself, as some identifiers have changed in iText:
So these 4 lines:
Become these 4 lines:
So after recompiling with the new JAR file and the changes to the Groovy code, Matt's function now works like a champ with the newest iText library ... and the problems with the recently-generated PDFs have vanished. Everything is working again!
Peace, love & brown rice,
FileMaker + Web: Design, Develop & Deploy
Certifications: FileMaker 9, 10, 11 & 12
Member: FileMaker Business Alliance
One Part Harmony
Austin, Texas • USA