I need users to be able to fill out a form in a PDF file using their browser then, when they click the submit button in the PDF file’s form, a new PDF file is saved with the contents they entered in the form.
One of the main examples I have been referencing is Adobe’s help section on this subject, but have had no luck: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec11c2b-7ffa.html
The PDF file I was provided didn’t have a submit action associated with it. So, I opened up LiveCycle designer and found the submit button and added this code to it:
<submit format="pdf" target="http://localhost:8500/pdfforms/pdfreceiver.cfm" textEncoding="UTF-16" xdpContent="pdf datasets xfdf"/>
Changing the target to the correct location on my local server, of course. Then, when I use this portion of code:
<cfpdfform source="#PDF.content#" action="read" result="fields"/>
<cfdump var="#fields#">
I get an error saying:
Element CONTENT is undefined in PDF.
I also tried opening it up in Adobe Acrobat X Pro and setting the action to submit the entire PDF file, but that didn’t work either. I’m using ColdFusion 9 on Windows 7 if that helps any. Thanks in advance for your help!
You don’t use CFPDFFORM to read the results from submitting a PDF. The PDF form should do a FORM POST to the target page, just like an html web form.
You can see the results of the form by doing a CFDUMP on the FORM scope:
Then you use a variety of methods to parse through and store that information in a database.