I discovered a CFPDF bug this week, and thought I'd post the
bug and a work-around.
We had an app which had been using CFPDF to MERGE files since
August (just after upgrading to CF8). We suddenly began
experiencing errors this past weekend.
The Error: DIAGNOSTICS: "null null <br>The error occurred on line
STACKTRACE: "java.lang.NullPointerException at
The Cause: It turns out over the weekend, the company providing the PDFs
had changed the layout slightly. Something about the way the new
file had been saved was throwing off the CFPDF tag when trying to
Other Symptoms: - When using the IsPDFFile() function, the new file checked
- Using CFPDF GETINFO on the new file yielded identical info
as an old file.
- CFPDF was able to successfully READ and WRITE the new file.
- READing the new file into a variable, or MERGEing directly
from the new file made no difference.
- Using a comma-list of PDF vars, or using CFPDFPARAM tags
made no difference.
- Specifying the pages from the new file to be included in
the MERGE made no difference.
The Solution: The solution was surprising to me. We needed to simply
re-save (or WRITE) the file while including the "saveoption"
attribute and setting it to "linear".
So before we attempt a merge, we first need something like
Then when we try our merge, it all works fine:
<cfpdf action="merge" name="FinalOutput">