views:

201

answers:

3

A client is asking how to create an interactive PDF form with functionality that allows the values entered into the form to be processed on the server.

From what I've read, the best way to do this is to program the submission by embedding javascript into the PDF file via Acrobat, then writing code on the server side to handle the submission.

Does anyone have experience doing this sort of thing? Is the best way to do this indeed by using javascript in the pdf file and using that to post the form values to the server-side form processing method?

If you do that, is there any way to pass back values to the PDF file that the form processed successfully?

A: 

We have used the DynamicPDF viewer from ceTE software. http://www.cete.com/

DevByDefault
A: 

If the requirement is just to pull data out of PDF form fields, Javascript may not necessarily be required. Javascript can certainly be used with form fields to handle certain requirements (oftentimes auto-calculation and validation), but it might be overkill for just setting and getting data.

There are APIs that will set and get data from PDF form fields pretty easily. One toolkit that does so is EasyPDF SDK, which has a PDFDocument class designed for exactly this:

 http://www.pdfonline.com/easypdf/epsdk_manual/index.htm?page=reference%2Fpdfdocumentsdk%2Fpdfdocument%2Fdescription.htm

Whether it will work for your needs will depend largely on whether the PDF has already been created or not. If it's already been created with fillable form fields, then EasyPDF SDK can be used to read data from the fields and insert data into them. But if you don't have the PDF template created yet, then you'd need Adobe tools like Acrobat Professional to do that first.

I will disclaim that I am part of the engineering team for EasyPDF SDK, so I have a vested interest in the tool. But it's nifty and easy to use, and is geared for server side deployment, so feel free to check it out at http://www.pdfonline.com if you feel so inclined. Hope this helps.

yu-chen-pdfonline-com
Thanks for the information. With the example listed above, it looks like the pdf file needs to be saved on the server with the filled-in values, is that correct? The scenario I'm looking at has the user download the pdf to their machine, fill it out and submit it to the server for processing. So the pdf has been created, but it hasn't been saved with the data filled out from the user.
meh
Right -- as of now the API is file-based, so it expects the input PDF to be on the file system of the local machine. Everything else about your workflow sounds like it would fly so long as the populated PDF can be saved on the server.
yu-chen-pdfonline-com
A: 

Hi,

We've built a tool (http://fourpdf.com/) that turns web pages into pdfs. It will work real-time, but there's nothing to stop you building the pdfs in advance and then circulating them.

If you built a standard html form that submits a POST back to your server, and then convert it to a PDF, you still get all the html functionality, right inside the PDF - you can fill out the form and click submit, and it will post to your website.

As per the chap from EasyPDF, obviously I've got a vested interest here, as it's our tool, but it's a simple solution, as you can build the form using standard html and process it server-side like you would with any website.

Regards, Jake.

Jake Liddell