# PDF Forms

**URL:** <https://forum.servoy.com/t/pdf-forms/3981>\
**Category:** Classic Servoy\
**Created:** [April 4, 2005, 7:30am UTC](https://forum.servoy.com/t/pdf-forms/3981 "2005-04-04T07:30:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![guydoms](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@guydoms](https://forum.servoy.com/u/guydoms)\
**Post date:** [April 4, 2005, 7:30am UTC](https://forum.servoy.com/t/pdf-forms/3981/1 "2005-04-04T07:30:55Z")

</div>

At a recent seminar, Jan Aleman mentioned that it’s possible to use PDF Forms within a solution…

How is this achieved ? Is it through a plug-in ? Has anyone done this that can give me a start ?

Any help or suggestions would be appreciated.

---

<div class="post-metadata">

**Author:** ![grahamg](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@grahamg](https://forum.servoy.com/u/grahamg)\
**Post date:** [April 4, 2005, 8:48am UTC](https://forum.servoy.com/t/pdf-forms/3981/2 "2005-04-04T08:48:12Z")

</div>

Following snip from earlier thread at [http://www.forum.servoy.com/viewtopic.p … t=pdf+plug](http://www.forum.servoy.com/viewtopic.php?t=3368&highlight=pdf+plug)

> Its downloadable in [http://forum.servoy.com/viewforum.php?f=1](http://forum.servoy.com/viewforum.php?f=1)
> 
> * * *
> 
> Jan Blok  
> Servoy

You may also want to look at [http://www.forum.servoy.com/viewtopic.p … t=pdf+plug](http://www.forum.servoy.com/viewtopic.php?t=2914&highlight=pdf+plug) for more discussion on pdf beans

Regards

Graham Greensall  
Worxinfo

---

<div class="post-metadata">

**Author:** ![guydoms](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@guydoms](https://forum.servoy.com/u/guydoms)\
**Post date:** [April 4, 2005, 9:42am UTC](https://forum.servoy.com/t/pdf-forms/3981/3 "2005-04-04T09:42:11Z")

</div>

Thanks Graham…

Just to clarify…What I’m after is support for pdf forms within Servoy…i.e. user wants to fill in existing pdf forms rather than native Servoy forms. The data entered on the pdf form would then update the DB. How do you bind the pdf form fields to the DB ? They ultimately want to do this via a Headless Client /Browser.

---

<div class="post-metadata">

**Author:** ![grahamg](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@grahamg](https://forum.servoy.com/u/grahamg)\
**Post date:** [April 4, 2005, 10:14am UTC](https://forum.servoy.com/t/pdf-forms/3981/4 "2005-04-04T10:14:09Z")

</div>

No problem & welcome to Servoy Forum

Think your specific requirement was covered in last two posts of the 2nd Forum link in my post.

> Is thier a way to use this bean to add and position text. ie) For instance to programatically fill out a form?
> 
> John McCann
> 
> No not possible but maybe we could build a merge function for PDF forms based on the lib used by the pdf printer plugin
> 
> * * *
> 
> Jan Blok  
> Servoy

prob worth contacting servoy support direct if there is a reasonable number of licences at stake ![:)]( "Smile")

Regards

Graham Greensall  
Worxinfo

---

<div class="post-metadata">

**Author:** ![guydoms](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@guydoms](https://forum.servoy.com/u/guydoms)\
**Post date:** [April 4, 2005, 10:27am UTC](https://forum.servoy.com/t/pdf-forms/3981/5 "2005-04-04T10:27:57Z")

</div>

Thanks..will do ![:D]( "Very Happy")

---

<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 4, 2005, 4:07pm UTC](https://forum.servoy.com/t/pdf-forms/3981/6 "2005-04-04T16:07:06Z")

</div>

At the seminar Jan Aleman mentioned the pdf form plugin that we are currently using that allows saving and retrieving of PDF form data. It is a Servoy plugin that has not been “officially” announced yet, but it is not a secret.

You can see a flash movie that shows how it is used in our solution at:

**[Loading...](http://www.acrobatforms.com/AgencyAnywhereFlash.html)**

This solution has only been tested on the **Windows platform**. I do not know if the plugin will work on other platforms.

---

<div class="post-metadata">

**Author:** ![guydoms](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@guydoms](https://forum.servoy.com/u/guydoms)\
**Post date:** [April 4, 2005, 4:23pm UTC](https://forum.servoy.com/t/pdf-forms/3981/7 "2005-04-04T16:23:15Z")

</div>

Thanks…Sounds intersting…I’ll take a look.

---

<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 5, 2005, 9:00pm UTC](https://forum.servoy.com/t/pdf-forms/3981/8 "2005-04-05T21:00:56Z")

</div>

I just changed the above link to point to a **flash movie** that shows use of the Servoy PDF form fill-in and save plugin in our solution (instead of continuing to provide a live link to our solution).

---

<div class="post-metadata">

**Author:** ![idoctor](https://avatars.discourse-cdn.com/v4/letter/i/a88e4f/32.png) [@idoctor](https://forum.servoy.com/u/idoctor)\
**Post date:** [April 6, 2005, 2:14am UTC](https://forum.servoy.com/t/pdf-forms/3981/9 "2005-04-06T02:14:17Z")

</div>

I use it to populate fields in PDF forms as follows. It works well.

// First make a PDF form with field names ‘field1\_on\_the\_pdfform’ & ‘field2\_on\_the\_pdfform’  
// For me this worked when the form was created with Acrobate Pro 6.0 but not 7.0  
// Store the binary of the PDF form in database\_field\_pdf\_binary  
var field\_values = new Array()  
field\_values[0] = ‘field1\_on\_the\_pdfform’ + ‘=’ + ‘Pretty’  
field\_value[1] = field2\_on\_the\_pdfform’ + ‘=’ + ‘Cool’  
var pdfform = database\_field\_pdf\_binary  
var result\_pdf\_doc = plugins.pdf\_output.convertPDFFormToPDFDocument(pdfform,field\_values)  
// result\_pdf\_doc now contains the PDF form with the two field populated with Pretty & Cool

John McCann

---

<div class="post-metadata">

**Author:** ![guydoms](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@guydoms](https://forum.servoy.com/u/guydoms)\
**Post date:** [April 6, 2005, 7:01am UTC](https://forum.servoy.com/t/pdf-forms/3981/10 "2005-04-06T07:01:46Z")

</div>

Thanks for the suggestion John… ![:D]( "Very Happy")

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [April 6, 2005, 11:11am UTC](https://forum.servoy.com/t/pdf-forms/3981/11 "2005-04-06T11:11:44Z")

</div>

The last full beta installer (from the download area in the beta section) contains the pdf output and pdf form plugins. Make sure to check the pdf checkbox when installing. In the solutions/examples directory you will find a pdf form example solution that also contains a brief description on how to use it.

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [April 6, 2005, 12:05pm UTC](https://forum.servoy.com/t/pdf-forms/3981/12 "2005-04-06T12:05:51Z")

</div>

downloaded the installer and did a fresh install

Noticed the following two things:

- you first need to upgrade the repository
- the URL’s show only blank pages… am I missing something?

Paul

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [April 6, 2005, 12:16pm UTC](https://forum.servoy.com/t/pdf-forms/3981/13 "2005-04-06T12:16:31Z")

</div>

> pbakker:
> 
> - the URL’s show only blank pages… am I missing something?
> 
> Paul

do you have acrobat reader 6 installed with the webbrowser plugin?

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [April 6, 2005, 1:03pm UTC](https://forum.servoy.com/t/pdf-forms/3981/14 "2005-04-06T13:03:28Z")

</div>

got Acrobat 6.0 installed

Also a lot of plugins installed, but not one named something like webbrowser. Is that the exact name?

I am able to open PDF’s inside Internet Explorer, though, through other apps…

Trying to see where the issue lies, I thought of turning on the debugger. did so, clikced a button, but the method is executed immediatly, without ability to step through it with the debugger (Note: this is a fresh install!!)

In the console I see nullpointer exceptions.

Paul

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [April 8, 2005, 11:11am UTC](https://forum.servoy.com/t/pdf-forms/3981/15 "2005-04-08T11:11:39Z")

</div>

That is quite interesting. We did the following on multiple systems:

1. fresh install of 2.2rc (full installer)
2. check the pdf checkbox at install
3. make sure acro 6 or 7 is installed
4. create a db connection named pdf\_forms that points to user\_data database
5. import pdf forms example solution from example directory
6. create, edit and view forms

In all cases it worked flawlessly. Can you try to follow the exact steps above to see if that gives any problems?

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [April 8, 2005, 12:47pm UTC](https://forum.servoy.com/t/pdf-forms/3981/16 "2005-04-08T12:47:45Z")

</div>

Oddly, now it works… ![:?]( "Confused")

Only thing different between yesterday and today is that yesterday I didn’t create the pdf\_forms DB link, but imported it straight into the user\_data DB link…

Thought that should also work, wouldn’t it? If so, must have been some bad installation somehow…

Regarding the Debugger now working: If on the pdf\_template form with debugger on and you click the View button, the attached mathod is fired completely (it’s only 1 line of code), without being able to step through.

Never noticed that, but when the debugger is on, the first line seems to be executed immediatly.

Paul

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [April 8, 2005, 1:11pm UTC](https://forum.servoy.com/t/pdf-forms/3981/17 "2005-04-08T13:11:25Z")

</div>

The connection name is important yes. Otherwise the service that goes back does not know where to go to. You can configure it in the server admin screens.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [October 7, 2005, 5:47pm UTC](https://forum.servoy.com/t/pdf-forms/3981/18 "2005-10-07T17:47:07Z")

</div>

I am having some problems with this. I am trying to fill the fields of a pdf form using plugins.pdf\_output.convertPDFFormToPDFDocument

I don’t get it to work. What goes wrong is this:

```auto
field_values = new Array()
field_values[0] = 'f1-1=' + some_field; //'f1-1=John C.J.'
field_values[1] = 'f1-2=' + some_other_field; //'f1-2=Longlasting'

```

When I do

```auto
field_values = new Array()
field_values[0] = 'f1-1=John C.J.'
field_values[1] = 'f1-2=Longlasting'

```

it works.

Maybe I am missing something obvious, but I really don’t get it.

Thanks for any help!

Patrick

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [October 8, 2005, 3:33pm UTC](https://forum.servoy.com/t/pdf-forms/3981/19 "2005-10-08T15:33:07Z")

</div>

I did some more testing.

This code

```auto
field_values[0] = 'f1-1=John C.J.';

```

works for me. That means a field called “f1-1” is filled with “John C.J.”.

This code

```auto
field_values[0] = 'f1-1=' + 'John C.J.';

```

doesn’t work!? The field in the PDF is empty.

Could someone please look into this? I see myself currently unable to fill a PDF form with dynamic values not using a servlet…

Thanks  
Patrick

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [October 9, 2005, 8:55am UTC](https://forum.servoy.com/t/pdf-forms/3981/20 "2005-10-09T08:55:14Z")

</div>

Maybe the error is caused by something else?  
I checked your code and seems to work fine.

```auto
var some_field = "abc";
var some_other_field = "efg";
field_values = new Array()
field_values[0] = 'f1-1=' + some_field; 
field_values[1] = 'f1-2=' + some_other_field;
application.output(field_values[0])
application.output(field_values[1])

```

RESULT:  
f1-1=abc  
f1-2=efg

```auto
//global script test in crm demo
field_values = new Array()
field_values[0] = 'f1-1=' + forms.companies.company_name;
field_values[1] = 'f1-2=' + forms.companies.companiesid; 
application.output(field_values[0])
application.output(field_values[1])

```

RESULT:  
f1-1=Harrison Ltd  
f1-2=3004

[Next page](https://forum.servoy.com/t/pdf-forms/3981.md?page=2)
