0 Replies Latest reply on May 22, 2008 8:21 AM by bestpitch

    CFPDF MERGE null null Error

      Hi All,

      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 45."
      STACKTRACE: "java.lang.NullPointerException at com.adobe.internal.pdftoolkit.services.manipulations.impl.PMMPages.clonePage(Unknown Source) [...]"

      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 MERGE.

      Other Symptoms:
      - When using the IsPDFFile() function, the new file checked out.
      - 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 this:
      <cfpdf action="write" destination="C:\website\file-one.pdf" source="C:\website\file-one.pdf" overwrite="yes" saveoption="linear">

      Then when we try our merge, it all works fine:
      <cfpdf action="merge" name="FinalOutput">
      <cfpdfparam source="C:\website\template.pdf">
      <cfpdfparam source="C:\website\file-one.pdf">

      I hope this helps someone else out there.