# Can PDFTools be used to fill in PDF files

**URL:** <https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475>\
**Category:** questions\
**Tags:** pdf\
**Created:** [March 7, 2019, 4:33am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475 "2019-03-07T04:33:09Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [March 7, 2019, 4:33am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/1 "2019-03-07T04:33:09Z")

</div>

Hi,

Can PDFTools be used to fill in PDF Files.

No user interaction must be required, all in code.  
Each field in the PDF file has a unique name.  
Once the fields are filled in I must then print it.  
I must also select the correct Radio Button.

Please see attached PDF file as an example.  
[PDF With Fields.pdf](https://clarionhub-uploads.s3.dualstack.eu-north-1.amazonaws.com/original/2X/8/8d2b83dc24905f94d7b0f13a05f141282a0d6e3c.pdf) (141.7 KB)

Any help/advice would be appreciated.

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![carlitm](https://clarionhub.com/letter_avatar_proxy/v4/letter/c/6bbea6/32.png) [@carlitm](https://clarionhub.com/u/carlitm)\
**Post date:** [March 7, 2019, 6:14am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/2 "2019-03-07T06:14:23Z")

</div>

Hi Johan

You can use the PDF-XChange Viewer 2.0 ActiveX to do what you require. This can be done ‘invisibly.’ There is an example in the help file. Example name is pvxd2f20.app

I used this as the basis for form filling in a couple of my apps.

Hope this helps.  
Carl

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [March 7, 2019, 6:39am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/3 "2019-03-07T06:39:59Z")

</div>

Hi Carl,

Thank you very much for the quick and detailed reply.

I will look at the demo you mention and work from there and see if I can make it work..

I appreciate the help.

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [March 7, 2019, 2:28pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/4 "2019-03-07T14:28:08Z")

</div>

Hi Carl,

WOW this works great.  
Thanks.

Question please.  
After I have saved the filled in document how do I automatically print it from code?

Or even better if it is possible:  
Fill in the original form,  
Print the filled in form without saving it,  
Close the original form without saving  
Do you maybe have any suggestions please?

**_EDIT_** : Got everything working as I want it.  
Thank you very much again.

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [July 24, 2019, 1:59pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/5 "2019-07-24T13:59:03Z")

</div>

Johan,

Might you clarify the exact PDF-XChange product you used to accomplish what you needed?  
I see pricing for PDF-XChange Viewer Active-X SDK at $2459 whereas other developer products listed on the Tracker webiste can be significantly less. Just trying to find the right product to match a single application with ~50 users.

Cheers,  
Douglas

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 25, 2019, 5:54am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/6 "2019-07-25T05:54:25Z")

</div>

Hi Douglas,

I have the full PDF Tools version.  
You need PDF Tools as well as PDF-XChange Viewer 2.0 ActiveX.  
If I am not mistaken the ActiveX came with PDF Tools when I purchased it, it was years ago.

As far as I know Tracker don’t sell PDF Tools anymore and no development are done to it anymore.  
I might be wrong.  
Luckily it still works in C6.3 and C10 without any problems.

I agree their pricing on the website is very-very confusing, well the last time I looked at it.

Hope I explained it well enough.  
Shout if you need more information.

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [July 25, 2019, 12:49pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/7 "2019-07-25T12:49:06Z")

</div>

Thank you, Johan.

Buried deep in the Tracker website, I came across a statement that Clarion support ceased in version 6 of PDF Tools. Having never seen the product, I am unsure what constituted Clarion support or what it might take for using Clarion with the current PDF Tools version 8.

I have sent a message to Tracker but no word back yet. Would be interested to hear from any Clarion developers about recent experiences.

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 25, 2019, 1:22pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/8 "2019-07-25T13:22:19Z")

</div>

Hi Douglas,

Apparently when Craig left the company they decided to not support Clarion anymore.  
Craig was their Clarion Template developer.

I am not sure about Version 8.

My version still works perfect.

This is what I have:  
PDF-Tools Templates v4.1  
PDF-Tools Viewer Template v2.0  
PDF-XChange ActiveX Viewer Template v2.0  
PDF-XChange Driver Deployment Templates v5.0  
PDF-XChange Driver Deployment Templates v4.0

**PS:** If I remember correctly there was talk of someone taking the templates over but I can’t remember who and how far it got.

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 27, 2019, 1:02pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/9 "2019-07-27T13:02:13Z")

</div>

Hi Carl,

> [@carlitm](#):
>
> You can use the PDF-XChange Viewer 2.0 ActiveX to do what you require. This can be done ‘invisibly.’ There is an example in the help file. Example name is pvxd2f20.app

I just wanted to process another PDF file where I need to replace 80 variables in the PDF file.  
The RunJavaScript just crashes without any message or something.

If I only do 10 variables then it still works, anything more than 10 variables and it crashes.

Do you maybe know how I can fix this please?  
Is there maybe a setting that I need to set?

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![carlitm](https://clarionhub.com/letter_avatar_proxy/v4/letter/c/6bbea6/32.png) [@carlitm](https://clarionhub.com/u/carlitm)\
**Post date:** [July 27, 2019, 1:35pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/10 "2019-07-27T13:35:30Z")

</div>

I think the problem is that the thing you are trying to replace doesn’t exist in the file.

There is no error trap in the javascript.

Hth

Carl

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 27, 2019, 2:24pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/11 "2019-07-27T14:24:15Z")

</div>

Hi Carl,

I have tested by commenting out the first 10 and uncommenting the next 10 until I get to the last one and it replaced each batch of 10 that I uncommented.  
All of the uncommented variables is replaced.  
As long as I don’t try and do more then 10 variables.

Regards

Johan de Klerk

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 27, 2019, 3:42pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/12 "2019-07-27T15:42:40Z")

</div>

Hi Carl,

Some update.  
I tested with Clarion 6.3 and it works 100%, I have added 40 fields and replaced the variables.  
The same app, just opened in Clarion 10 and compiled crash/gpf.

I have attached both to this message just in case you can help and figure out what is wrong.

Regards

Johan de Klerk  
[PdfVAx20-Clarion63.zip](https://clarionhub.com/uploads/short-url/webVjskpc4RVDV3fEj6dOXRuduZ.zip) (1.4 MB) [PdfVAx20-Clarion10.zip](https://clarionhub.com/uploads/short-url/gP9vidu8jXlz3sYZe0NsUV0kcL8.zip) (1.6 MB)

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 28, 2019, 9:12am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/13 "2019-07-28T09:12:32Z")

</div>

I thought I would be clever and create 8 procedures for the76 PDF Variable replacements.  
Source procedure calls each replace procedure.  
PDFReplace1 does the first 10 variables, open PDF, replace, save pdf  
PDFReplace2 does the next 10 variables, open PDF, replace, save pdf  
PDFReplace3 does the next 10 variables, open PDF, replace, save pdf  
and so on until I get to all 76 variables.

This is also not working, crash/gpf when it does the 2nd one.

It seems I should never have done this project in Clarion 10, should have done it in my trusty old Clarion 6 and everything would have worked 100%.  
But can’t turn around now, already done 95% of the app in Clarion 10.

I am out of ideas how to make this work in Clarion 10.

**EDIT** : I have put debug statements in and it crash after the:  
Procedure setup standard formulas  
before the:  
Open Files

---

<div class="post-metadata">

**Author:** ![lchudakov](https://clarionhub.com/letter_avatar_proxy/v4/letter/l/c0e974/32.png) [@lchudakov](https://clarionhub.com/u/lchudakov)\
**Post date:** [July 29, 2019, 8:52am UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/14 "2019-07-29T08:52:20Z")

</div>

You can fill in fields in PDF document using QuickPDF Library

> **[About](http://klarisoft.com/KSNews_160.htm)**

---

<div class="post-metadata">

**Author:** ![Johan\_de\_Klerk](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@Johan\_de\_Klerk](https://clarionhub.com/u/Johan_de_Klerk)\
**Post date:** [July 29, 2019, 3:27pm UTC](https://clarionhub.com/t/can-pdftools-be-used-to-fill-in-pdf-files/2475/15 "2019-07-29T15:27:36Z")

</div>

Hi,

Thanks for the link.

I would like to try and make PDF Tools work.

QuickPDF is another R7300.00 expense that I don’t have money for at this stage.

Regards

Johan de Klerk
