# PDF Plug in Help

**URL:** <https://forum.servoy.com/t/pdf-plug-in-help/8991>\
**Category:** Classic Servoy\
**Created:** [April 8, 2008, 3:15pm UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991 "2008-04-08T15:15:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![John49](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@John49](https://forum.servoy.com/u/John49)\
**Post date:** [April 8, 2008, 3:15pm UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991/1 "2008-04-08T15:15:56Z")

</div>

Hi,

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](http://localhost:8080/servoy-service/pdf_forms/pdf_process_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?

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 8, 2008, 4:19pm UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991/2 "2008-04-08T16:19:50Z")

</div>

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:

```auto
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.

Dean Westover  
Choices Software, Inc.

---

<div class="post-metadata">

**Author:** ![John49](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@John49](https://forum.servoy.com/u/John49)\
**Post date:** [April 9, 2008, 10:22am UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991/3 "2008-04-09T10:22:48Z")

</div>

Thanks for the help Dean.

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?

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 9, 2008, 6:34pm UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991/4 "2008-04-09T18:34:10Z")

</div>

Try this:

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.

Dean Westover  
Choices Software, Inc.

[Address1.pdf](https://forum.servoy.com/uploads/short-url/eNiubVJBEDARynUGUW8AjBlRVLV.pdf) (195 KB)

---

<div class="post-metadata">

**Author:** ![John49](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@John49](https://forum.servoy.com/u/John49)\
**Post date:** [April 11, 2008, 8:06am UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991/5 "2008-04-11T08:06:10Z")

</div>

Many thanks Dean that sorts it. Very much appreciated.

Is there a way to change the confirmation behaviour (i.e. direct them to back to our homepage for example)

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [April 11, 2008, 5:48pm UTC](https://forum.servoy.com/t/pdf-plug-in-help/8991/6 "2008-04-11T17:48:14Z")

</div>

Yes. For webclient, in the global.btn\_viewPDF method replace the corresponding lines with the following:

```auto
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.

Dean Westover  
Choicdes Software, Inc.
