Programmatic form filling - How?

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

wendellf
User
Posts: 1
Joined: Fri Jan 31, 2014 9:39 pm

Programmatic form filling - How?

Post by wendellf »

I've been told my company has an Enterprise license for "PDF-XChange Viewer ActiveX SDK". We are evaluating using for one of our use cases to replace an existing tool (ActivePDF Toolkit). Below are the features that we have to perform to meet our use cases and I was wondering if this was possible using this tool?

1) Open a PDF form and programmatically retrieve the list of form fields and their names.

2) Open a PDF form and programmatically set all form field contents using the form field names.

3) After filling the form data, flatten the PDF and save it under a different name.

This has to be done from C# and VB6 (although we can do a COM wrapper from C# if needed to support the VB cases). All of this needs to be accomplished with no UI elements. We have two use cases for these features:

1) retrieve a set of records from our database for a group of individuals and create a PDF for each of these individuals by filling the form data from the database records and saving a flattened, individual PDF for each individual. This is done in with a batch application and can produce between 500 and 100,000 PDFs in a given run.

2) Same as the first only it is for a single individual and the resulting PDF will be streamed back to a browser.

Any help would be greatly appreciated.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Programmatic form filling - How?

Post by Vasyl - PDF-XChange »

Hi, wendellf.
1) Open a PDF form and programmatically retrieve the list of form fields and their names.
2) Open a PDF form and programmatically set all form field contents using the form field names.

Code: Select all

for ( var i=0; i < this.numFields; i++) 
{
     var fname = this.getNthFieldName(i);
     var f = this.getField(fname);
     ... 
     f.value = newValue;
}
3) After filling the form data, flatten the PDF and save it under a different name.

Code: Select all

this.flattenPages();
this.saveAs("/c/temp.temp.pdf");
For more info about JS:
http://www.adobe.com/content/dam/Adobe/ ... erence.pdf
1) retrieve a set of records from our database for a group of individuals and create a PDF for each of these individuals by filling the form data from the database records and saving a flattened, individual PDF for each individual. This is done in with a batch application and can produce between 500 and 100,000 PDFs in a given run.
2) Same as the first only it is for a single individual and the resulting PDF will be streamed back to a browser.
In my opinion - in both cases for the server side you must implement your own application-wrapper that may embed our ActiveX control and provide special communication method between your app. and web-service...

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.