Is this possible and do you have any sample code to demonstrate this:
1. Show a PDF form in the browser (the PDF would come from the server or a CDN like Amazon S3).
2. Fill out some form fields in the PDF (text fields, checkboxes, etc.) with data in the main HTML page that contains the WebViewer.
3. Allow the user to interact with the form, perhaps correct some of the autofilled fields, add new data, etc.
4. Save the completed form back to the server after the user is done editing it.
When the form is submitted in the sample it triggers our sample formDataHandler.php script that can be found in the WebViewer download under the html5 folder.
To programmatically change form fields you could use a config file like our forms sample is doing (samples/forms/config.js) and add code like this:
$(document).on("pageCompleted", function(event, pageNum) {
if (pageNum === 1) {
$('#f1-9 > textarea').val('abc').blur();
$('#c1-2 > input').prop('checked', true).change();
}
});
This will set the value of one of the text inputs to 'abc' and check one of the checkboxes in that sample form document. It's important to have the .blur() or .change() at the end to make sure that the correct event handlers are triggered for the elements as they aren't triggered automatically when changing values programmatically. Currently textareas are the only one that should use .blur() however this will likely be changed in version 1.7 to .change() to be consistent with the others.