Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Submit pdf form fields to a HTTP POST request

I've made a pdf form in Adobe Acrobat. Now I want to make a button that submits the form to a HTTP POST request. I have searched for about 4 hours, but I have not found an example to do this.

Here I read that it is possible to send the pdf form fields with a HTTP submission, but there's also no example given: http://acrobatusers.com/tutorials/form-submit-e-mail-demystified

I'm looking for a JavaScript example that I can link to the submit button.

like image 901
Josjojo Avatar asked Dec 03 '10 14:12

Josjojo


People also ask

How do you allow filling of form fields PDF?

To enable the Fill & Sign tools, choose File > Save As Other > Reader Extended PDF > Enable More Tools (includes Form Fill-in & Save). The tools are enabled for the current form only. When you create a different form, redo this task to enable Acrobat Reader users to use the tools.

How do I embed a fillable PDF into my website?

If you're okay with your online PDF form, click Publish. After you publish the form, the sharing window will appear. From there, you can get the code under the Embed Script tab and paste it on your website.

How do you submit a PDF form?

Choose Tools > Prepare Form, then select Button in the toolbar, and create a button. Double-click the button to open the Button Properties dialog box. Click the Actions tab, and select Mouse Up from the Select Trigger menu. Select Submit A Form from the Select Action menu, and then click Add.


1 Answers

doc.submitForm(url, false);

or

doc.submitForm( url, null, null, null, null, null, null, null, null, null
                null, null, null, null, null, "HTML" );

submitForm actually takes 23 different parameters, the above is only using 16 of them. And if I miscounted, I'm trying to use the cSubmitAs parameter.

This from the JavaScript API reference, which can be found at... lets see... right here. Enjoy.

PS: "this" is almost universally the document in acrobat events. event.target might be a field or something, but "this" is going to be the document.

PPS: Things like bEmpty, aFields, and various other parameters don't work when bFDF = false.

like image 111
Mark Storer Avatar answered Sep 21 '22 16:09

Mark Storer