Currently we are testing out an idea with legal documents (contracts) where we would generate a pdf form (with some data autofilled from our database) this form would then be sent to a customer via an email attachment and they would then check the information, add extra & correct where required and then digitally sign & submit the form back to us.
The Servoy PDF plug in seems to be suited for this, but we have been unable to activate the even the functionality of the PDF form demo solution.
Currently we can launch a pdf form and edit it, but when we click ‘submit’ it directs to http://localhost:8080/servoy-service/pd … ocess_data (blank page) from there, nothing. How is this part of the process meant to work, I understand that when the user clicks submit that web services creates new records in the pdf table, but how does it do this and what business rules are involved (I cannot find documentation on this).
Also does anyone know off hand what could be the cause of my fault?
I just tried the sample pdf solution and experienced the same problem that you describe. After opening the sample address1.pdf file with the full version of Adobe 5 and looking at the Submit button, I see that the Javascript code described on page 548 of the Servoy Developer Volume II Reference Manual appears to be missing. Per the manual, the following JavaScript code must be added to the mouse-up action of the button:
var ef = this.getField("servoy_pdf_submit_url")
this.submitForm(ef.value)
Perhaps this missing code is what is causing the problem.
When the submit button is working properly it submits field name/field value pairs back to the database.
With regard to the work flow you describe, you may find that it is better to email a link to the pdf form solution, instead of emailing the actual pdf form. This will allow the form to be opened in a browser, where it can be completed and submitted with the free Adobe Reader. Otherwise, I believe the end user would need the full version of Acrobat.
We created a new form with the Javascript in and hidden fields as per manual (see attached) & imported that into the Demo solution.
This stops on the submit button without moving to a new page at all.
Do you know if using when using the demo solution if clicking the submit button would give feedback normally?
Using the full version of Acrobat, on the sample address pdf form rename the “action_id” field to “servoy_action_id”. Attached is the revised sample form for those who do not have the full Acrobat.
After you bring the revised form into the sample solution as a new template, be sure to click the "Save’ button in the upper right corner.
Yes. For webclient, in the global.btn_viewPDF method replace the corresponding lines with the following:
forms.frm_forms.pdf_forms_to_pdf_actions.redirect_url = '/servoy-webclient/solutions/solution/servoy_sample_pdf_forms';
forms.frm_forms.pdf_forms_to_pdf_actions.action_type = actionType;//==edit = 1, view = 0
//get the new record id
var action_id = forms.frm_forms.pdf_forms_to_pdf_actions.action_id
forms.frm_forms.controller.saveData();//so changes are seen by servlet
forms.main.controller.show();
if(application.getApplicationType()==5)
{
application.showURL('/servoy-service/pdf_forms/pdf_form/load.fdf?action_id=' + action_id,'_self');
}
Notice the first line and also notice the change to ‘_self’ at the very end. Use “_self” to keep user within the same browser window, avoiding “pop-up” issues. The “forms.main.controller.show()” controls the leaving and returning form. Another option is to just set the redirect_url to something like ‘/myhomepage.html’.
The above works for me with webclient on Windows XP with Internet Explorer. You will need to test for other operating systems and browsers.