PDF Form data Submission Via REST API / Web Services - pdf

I am having a PDF form that saves the data and validate the data entered by user e.g. a client information PDF document that takes client data and when user click on send button, it must post the data to the web service that further process it or saves to database.
I am using Acrobat Professional for this. Can anyone help in this?

Acrobat and Adobe Reader can submit form data to any URL using a button on the document and the "Submit a Form" action or via Acrobat JavaScript (probably unnecessary). You just need something on the server to interpret the data. If you submit as HTML, the submission will look just like query parameters where the key names are the same as the names of the fields and the values, same as the field values without the formatting. To the server, it looks like it was submitted from a standard HTML form so just about anything you have will be able to work with the submission.
You need to use Acrobat Pro to add this button to the document but then Standard and Reader can use it.
See https://helpx.adobe.com/acrobat/using/setting-action-buttons-pdf-forms.html
You can also submit as FDF or XFDF, an XML(ish) expression of FDF, in which case you'll want to use something like the FDF Toolkit to read it but based on your question, I don't think you need to do that.
3rd party edit
Information from the linked page
FDF
Returns the user input without sending back the underlying PDF file.
You can select options to include Field Data, Comments, and
Incremental Changes To The PDF.
XFDF
Returns the user input as an XML file. You can include Comments with
the field data or just the field data.

Related

Is there an possibility to save a dynamic pdf as static but still have interactive fields within the document?

I have a dynamic pdf which I want to use for DocuSign and thus needs to be static. I cannot simply make use of the print as pdf function as I still want to use the interactive fields within the pdf.
I Tried to use Adobe AEM Forms Designer to save the document as static. But solely the first page of the form is saved.
Regarding your concern, I would like to share the following information, you can learn about PDF form field transformation. It enables you to transform PDF form fields automatically into DocuSign tabs, carrying over all of their existing values. The locations of the created tabs will match the locations of the fields from which they were generated.
To transform PDF form fields into DocuSign tabs, you need to set the transformPdfFields property on the documents whose fields you want to transform.
https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/tabs/pdf-transform/
https://www.docusign.com/blog/developers/the-trenches-pdf-form-field-transformation
Best Regards,
Eric | DocuSign

Let a PDF prompt for an input and insert it

I would like a PDF for some support workers, which should be easily editable.
I need it to ask on first open for a kind of Customer ID. This should be inserted into the document. Is this possible?
Thanks for help!
This requires either a smart PDF viewer (such as Adobe Acrobat (Reader) on computers, PDFExpert on iDevices, qPDF on Android) OR serverside support.
In the first case, you would use the app.response() method to let the user enter that identifier and then set the result to the according field's value. That could be placed in the PageOpen event of the page the document opens.
Also doing its purpose would be setting the focus to that field when the page opens.
With server support, you could set up a HTML page where the user enters the identifier, submit that to the server, and have the server prefilling the form, using either a ready application like FDFMerge by Appligent, or using one of the PDF creating libraries floating around (such as iText, pdflib, etc.).

Generating PDF in Orbeon

We would like to generate a PDF without using the existing "PDF" button, but we would like to add our own button that gets a custom template and generates a document filled by the data in the form.
Which Orbeon API we can use for this purpose? This API will get the form id and the PDF template and will generate the document.
The API should give us the possibility to :
Map data to the PDF.
Save the PDF in a given directory.
Sdd some changes to the PDF like adding an image and save the document (this will be our custom code).
Download the PDF after process.
What you're looking for sounds very much like Orbeon Forms' PDF template feature. With Form Runner, you can add your own buttons to the form, and those buttons can have their own label and "logic". The latter is defined in a process, which is a sequence of actions. One of those actions is send(), which as its name implies, "sends" some information related to the form to a service you provide.
You can configure that action to send a PDF generated by "filling" a PDF template with the data entered by users in the form by using send(content = "pdf"). You can find more about this in the documentation for the send() action.

How to convert XDP to PDF in Adobe LiveCycle ES3 via HTTP REST request

I have: LiveCycle server (ES3, JBOSS), Workbench, Designer.
Using LC Desginer I convert PDF to XDP - it's template now.
Now I need to convert that XDP file to PDF.
So, I guess I should somehow call LiveCycle server by HTTP request, in body of this request I can send body of XDP document. All what I need from LC is just PDF.
Looks like simple task, but I can't find ANY information how to do this. I see a lot of examples how to do this in Java, but I don't need Java, I need to do it via HTTP (REST endpoint or SOAP if it's not possible).
Maybe I need to create some "application" in Workbench? If so, is there any step-by-step documentation? Or maybe somebody can explain me, how to do this. Maybe there is already build-in application in ES3 Server - I think it's very common and simple case.
UPD: I've opened job at Odesk for this issue, I promise to post solution here to share knowledge with community
As was promised, here is how to solve this issue:
It's not enough just put PDF into LiveCycle Designer. You exactly need to design form in LC Designer. You can use your PDF as template, but for all things which you want to fulfil by your custom data, you need to add objects in LC Designer (take a look at the "Insert" menu, try Table or Text Field) and add Data Connection in the "Data View" tab. I think it's pretty easy step for professionals, but it can take some time to get by beginners. Save results of your work as, for instance, Template.xdp file.
Also you now have the example of XML file - source of the data. Let's name it DataSource.xml
Now we can install LiveCycle Server. Best for LC ES3 is RHEL 5.5 (we spent around 2 days just to find correct combination of OS and settings). You'll need a clever system-administrator (or just experienced in Adobe LiveCycle :))
Server is working now, you can see web-interface, so let's create application in Adobe LiveCycle Workbench ES3. Add an application with new name and add a process to that application. It will take to many words to describe all steps of process, just take a look at screenshots of result (and notice variables also):
Now most easy part - call this app by the HTTP request. But we can't just send usual POST request to Adobe LiveCycle :) We have to send content of 2 files (Template.xdp and DataSource.xml) as multipart/form-data and names of the parts are the names of input variables (in my example is xmlTemplate and xmlData). And don't forget Authorization header with Basic authorization credentials.
In the Response you'll receive base64-encoded body of the PDF document.
Thanks to Thierry Stortenbeker for this application and for help and patience.
Yes, you have to create an LC application using workbench. Here is how to do it:
Create a new application in workbench using File -> New -> Application.
Create a new Process using the right click menu at the application.
Drop in renderPDF form activity from the activity and name it "renderPDFForm".
Select renderPDF form activity to add variables using the bottom pane of variables.
Add a variable of "Document" type and name it "inputXDP". We will use this to pass xdp file. Mark it to be "input" variable.
Add a variable of "Document" type and name it "outPDF". Mark it to be "output" variable.
Now double click renderPDFForm activity, this will open a property editor on the left side.
Expand "Input" section if not expanded already. Make sure "Form" to be picked up from variable. Then choose "inputXDP" from the dropdown.
Expand "Output" section if not expanded already. Make sure "Rendered Form" to be picked up from variable. Then choose "outPDF" variable from the dropdown.
Now deploy your application by right click menu on application.
That is it. You are ready to go. Now save the process and double click "default start point" to get the rest url where this service would be exposed. The rest url should look like http://localhost:8080/rest/services/RestFormRender/renderForm:1.0. Here RestFormRender is name of the application and renderForm is name of the process. Now make a GET/POST call to this REST url and specify XDP bytes in "inputXDP" request parameter.

Saving the modified contents of a pdf

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?
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
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.
This document may help you:
http://www.adobe.com/education/instruction/teach/coldfusion/CF8-2_advanced_cf8_development_unit8.pdf