views:

85

answers:

3

I've got a form that I downloaded, I'd like to prefill some content on the form (this is easy using cfpdfform).

Where it gets tricky is I would like to allow the user to modify the contents of that form, and then somehow have those modified contents accessible to me. I didnt build the source PDF so I dont know how to allow the user to "save" the new contents so they can be read.

Any ideas on where I might start on this one?

+2  A: 

It's possible for users to complete most PDF forms in Adobe Reader, but when user's try to save the changes they get a popup prompting them that the PDF cannot be saved and would need to upgrade to Adobe Acrobat to have this functionality.

Since Acrobat 7 (or possibly) 8 it's possible to create a form so that it can be completed and saved in reader. In Acrobat open your PDF, and select Advanced -> Enable usage right in reader from the menu. This will prompt you to save the form and then anyone using Adobe reader can complete it.

Once that's done you can open the form in ColdFusion, populate some of the fields and serve it up to the user. Once they fill it in, save it and get it back in ColdFusion you can read the contents using the PDF related tags.

Please note: It's currently not possible to set the "enable usage rights in reader" flag from ColdFusion, you need a copy of Adobe Acrobat or access to Adobe LifeCycle server to do this.

Loftx
Thanks for the tip, It's interesting to note that forms that have had that flag modified such that reader can now save them will cause an ugly warning saying that the PDF has been modified. Apparently anything you do that results in a modified hash of the original PDF will do this.
Anthony Webb
Yes, they do not want you modifying it with anything other than LiveCycle.
Leigh
+4  A: 

You can also use the cfpdfform tag to read/write data to a PDF file which has a form. The important thing is that the PDF document already have the form fields available, or that you add them.

I just recently completed a task where I had to have a user fill out a normal web form, and then create a filled version of an existing PDF document. It worked like a breeze!

I think that depending on what you are trying to accomplish, having the user fill out the data in a web form is less confusing than serving up a PDF and expecting them to save that to update a file on a remote server. Just my opinion, though.

http://www.cfquickdocs.com/cf8/?getDoc=cfpdfform#cfpdfform

Jason
I think you are right actually, it will take some work to recreate the form, but using an HTML form might provide some longer term benefits like easy JS validation and accessibility on devices like an iPad.
Anthony Webb
@Anthony - +1. I really think that is the better option too. It is simpler and as you say more accessible.
Leigh