0 Replies Latest reply on Nov 19, 2009 11:12 AM by HJSchmidt

    cfpdfformparam changing ALL form values....

    HJSchmidt

      This may appear simple, so please don't provide a knee jerk answer without reading this all the way through.  THANK YOU! 

       

      SITUATION:  I have to be able to open a Form PDF file that is created from a 3rd party (I have NO control of how the PDF is created - this is important for all of you to accept).  I then have to populate form field f80 with a registration number.  I then have to save the document and pass it on to the appropriate parties.  Sounds simple?  Well, I thought so until I noticed something strange happening.

       

      Some of the fields that exist in the document (for example f2000) are hidden behind text on the PDF file.  Whenever I do a cfpdfformparam to assign a value to f80, then ALL form values are "brought forward" and replace whatever was layered on top of it.  Make sense?  I didn't think so.  The best thing to do is to see it for yourself.

       

      Attached is the ORIGINAL pdf (file1.pdf).  Go to page 2 of the document and scroll down to the "HERS REQUIRED VERIFICATION" section.  You will notice that the first entry in that section says something like: "The Cooling System CARRIER 58MVP080-2.......".  Now in Adobe Professional (or I think even Reader) click on the field.  See what happens?  The text "The Cooling System CARRIER....." is replaced with "Front (N)".  When I questioned the author of the PDF as to why it's done like this, his reponse was that the form is created generically and certain values are "replaced" with x,y coordinate placement of text and that process could not be changed.  I am only saying this to anyone who is about to suggest that I have the original PDF file created differently.  As I stated in my SITUATION, I have NO control of how the PDF is created, I have to make it work on my end.   Got it?  lol

       

      So now here is the bizarre step.  If I do a typical ColdFusion cfpdfformparam to form field f80 like so:

       

      <cfpdfform source="D:\file1.pdf" action="populate" destination="D:\file2.pdf" overwrite="true">
           <cfpdfsubform name="topmostSubform[0]">
            <cfpdfsubform name="Page1[0]">
             <cfpdfformparam name="f80[0]" value="Reg: 209-N1234567B-00000000-0000">
          </cfpdfsubform>
           </cfpdfsubform>
      </cfpdfform>

       

      I open up the file2.pdf and the text "The Cooling System CARRIER 58MVP080-2......." has been replaced with "Front (N)" along with SEVERAL other sections of the form.  If I try and read the original PDF:

       

      <cfpdfform source="file1.pdf" result="cf1R" action="read"/>

      <cfdump var="#cf1R#">

       

      I notice that "The Cooling System CARRIER 58MVP080-2......." does not exist anywhere.  I am able to find a value "Front (N)" assigned to f2000.

       

      So what I have discovered is this.  If I do a cfpdfformparam to any value, then ALL form params replace anything that was visibly created on the PDF file.  How can I keep this from happening?

       

      Is there any other way of assigning f80 WITHOUT affecting the rest of the PDF document.  I read somewhere that you could write some text in a PDF document based on x,y coordinates, but can't find an example of how. That would likely be my best solution.

       

      PLEASE HELP!!!!