Filling out a form programaticallty
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Filling out a form programaticallty
We were given a .pdf form. We would like to programatically fill out the form with user name, etc. from an oracle table, and email the form to the user. They will fill in the rest and send it back.
My thought was to just create a series of .fdf files and merge these in 1 at a time. Would that work?
What are some alternative choices? If I need the SDK, so be it.
Paul
(What has Clarion got to do with pdf files?)
My thought was to just create a series of .fdf files and merge these in 1 at a time. Would that work?
What are some alternative choices? If I need the SDK, so be it.
Paul
(What has Clarion got to do with pdf files?)
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
If you can use the FDF format, go for it!
If you want to do it a bit more dynamically, please download the Viewer SDK from the Developer Downloads, and then check out demo pvxd2f20.app for an example of filling out a form programmatically.
If you can use the FDF format, go for it!
If you want to do it a bit more dynamically, please download the Viewer SDK from the Developer Downloads, and then check out demo pvxd2f20.app for an example of filling out a form programmatically.
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Ok thanks, I'll have a look at the SDK.
Is info avalable about the parts of the .fdf file that aren't intuitively obvious? (ie, the binary or encryppted fields)
Paul
Is info avalable about the parts of the .fdf file that aren't intuitively obvious? (ie, the binary or encryppted fields)
Paul
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
Not from us. However, the FDF format should be documented by Adobe. I'd check their website for FDF documentation.
The example I recommended to you is a "database to form fields" using the Adobe Acrobat JavaScript extensions. It does not use FDF at all.
Not from us. However, the FDF format should be documented by Adobe. I'd check their website for FDF documentation.
The example I recommended to you is a "database to form fields" using the Adobe Acrobat JavaScript extensions. It does not use FDF at all.
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Oh, I see! Thanks - Then I'm off to look at the sdk.
Paul
(I get the clarion reference now...)
Paul
(I get the clarion reference now...)
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
I don't have that available as a demo - Is it a language specific demo that I didn't install...?Tracker - Clarion Support wrote:... the Viewer SDK from the Developer Downloads, and then check out demo pvxd2f20.app .
Paul
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
It's Clarion-specific. This is posted in the Clarion forum.
What language are you developing this in?
It's Clarion-specific. This is posted in the Clarion forum.
What language are you developing this in?
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
When I first showed up at the site, Clarion was the only forum visible. (I did ask right off the top what clarion had to do with the product - and I get that now)
I haven't settled on a language yet, but did install for c++ c# and both VBs.
Paul
I haven't settled on a language yet, but did install for c++ c# and both VBs.
Paul
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Filling out a form programaticallty
Do you see the other Forums now Paul?
As if not I can check your account's privileges and fix that.
Regards,
Stefan
As if not I can check your account's privileges and fix that.
Regards,
Stefan
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Stefan,
I'm good now, thanks.
Paul
I'm good now, thanks.
Paul
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Filling out a form programaticallty
Ok so then this topic is in the wrong forums and the examples quoted by Craig are Clarion specific.
I will check now whether there are corresponding C++ examples.
Cheers,
Stefan
I will check now whether there are corresponding C++ examples.
Cheers,
Stefan
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
Glad to see you got that sorted!
If it's Visual C++ I can still help, but my C# and VB is weak.
Glad to see you got that sorted!
If it's Visual C++ I can still help, but my C# and VB is weak.
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Thanks Stefan - that's all I need at this point.
(I didn't think anyone would want me to start over elsewhere.)
Paul
(I didn't think anyone would want me to start over elsewhere.)
Paul
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
We can move this thread to another forum, so that's cool.
However, the internal basics of Viewer ActiveX JavaScript remain the same, so I'm posting the JS we use in the Clarion program:
function loadfield remains the same in all cases.
The lines that execute loadfield at the end are built by the calling program and then the whole thing is passed to the Viewer ActiveX. The first field in each call is the PDF Form field name; the second is the data to be inserted in that field.
We can move this thread to another forum, so that's cool.
However, the internal basics of Viewer ActiveX JavaScript remain the same, so I'm posting the JS we use in the Clarion program:
Code: Select all
function loadfield( fldName, fldValue ) {
var tst = fldName.toUpperCase();
for ( var i = 0; i < this.numFields; i++ ) {
var fname = this.getNthFieldName(i);
var ft = fname.toUpperCase();
if ( tst == ft ) {
var f = this.getField(fname);
switch( f.type ) {
case "text":
f.value = fldValue;
break;
case "listbox":
case "combobox":
for ( var j = 0; j < f.numItems; j++ ) {
if ( fldValue == f.getItemAt(j) ) {
f.currentValueIndices = j;
break;
}
}
if ( f.type == "combobox" )
f.value = fldValue;
break;
case "checkbox":
switch ( fldValue.toUpperCase() ) {
case "OFF":
case "NO":
case "FALSE":
case "0":
f.checkThisBox(0, false);
break;
default:
f.checkThisBox(0, true);
break;
}
break;
case "radiobutton":
f.checkThisBox(fldValue - 0);
case "button":
case "signature":
default:
break;
}
}
}
}
// Added by Calling Program:
loadfield("DATE","75546");
loadfield("TIME","7712827");
loadfield("EMAIL","craigr@docu-track.com");
loadfield("ACCOUNT","MyAccount");
loadfield("PASSWORD","MyPassword");
loadfield("FIRSTNAME","Craig");
loadfield("LASTNAME","Ransom");
loadfield("BIRTHDATE","09/11/1947");
loadfield("BOOKSCHK","Yes");
loadfield("MAGAZINESCHK","Yes");
loadfield("NEWSPAPERSCHK","Yes");
loadfield("COUNTRY","Germany");
The lines that execute loadfield at the end are built by the calling program and then the whole thing is passed to the Viewer ActiveX. The first field in each call is the PDF Form field name; the second is the data to be inserted in that field.
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Stefan,
Thank you! Looks to be just what I need.
Move if you weill
Paul
Thank you! Looks to be just what I need.
Move if you weill
Paul
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Filling out a form programaticallty
Well the kudos are for Craig - he is the one "hiding" behind Tracker - Clarion Support
As for the topic - moved it to the non Clarion Viewer SDK forum.
Cheers,
Stefan
As for the topic - moved it to the non Clarion Viewer SDK forum.
Cheers,
Stefan
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
I'm working with the VB Full Demo at the moment, and pasted the JS code into the Java Script window - modifying the bottom bit for the correct field names - works like a charm.
This begs the question: does that mean the 'native' language for the active-x control is JS? Said another way - is there some other non-js way of filling in the fields? ...or... It just feels wrong somehow to come up with a basic VB app (no pun intended) at the heart of which is a bit of JS code to do the grunt work.
Paul
This begs the question: does that mean the 'native' language for the active-x control is JS? Said another way - is there some other non-js way of filling in the fields? ...or... It just feels wrong somehow to come up with a basic VB app (no pun intended) at the heart of which is a bit of JS code to do the grunt work.
Paul
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
For the Viewer ActiveX, as far as I know, JS is the only way at the current time. I'll ask our Project Manager to be sure.
If not, they may add better form management in version 3, but that is no time soon. Don't ask for a time frame for 3; I have none.
For the Viewer ActiveX, as far as I know, JS is the only way at the current time. I'll ask our Project Manager to be sure.
If not, they may add better form management in version 3, but that is no time soon. Don't ask for a time frame for 3; I have none.
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Craig,
Thanks for checking...
If any of the other SDKs have direct field support, them I'm all ears. I'll continue to have a look at the demo for now.
Paul
Thanks for checking...
If any of the other SDKs have direct field support, them I'm all ears. I'll continue to have a look at the demo for now.
Paul
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: Filling out a form programaticallty
No, it is not. JS is just one more way to do the job, or often only one possible way to do it when feature isn't supported directly by AX (like with forms - AX doesn't provide objects to work with form fields).This begs the question: does that mean the 'native' language for the active-x control is JS?
You can use JS not only from AX, but also in end-user viewer through JS console (use Ctrl + J shortcut to open it).
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi guys!
Which is how I originally tested my script !You can use JS not only from AX, but also in end-user viewer through JS console (use Ctrl + J shortcut to open it).
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Ahh, I see now.Just a way of being 'future ready'. Cool.Ivan - Tracker Software wrote:JS is just one more way to do the job, or often only one possible way to do it when feature isn't supported directly by AX (like with forms - AX doesn't provide objects to work with form fields).
You can use JS not only from AX, but also in end-user viewer through JS console (use Ctrl + J shortcut to open it).
Paul
-
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
Re: Filling out a form programaticallty
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
-
- Site Admin
- Posts: 64
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
Re: Filling out a form programaticallty
Hi Paul!
Actually there's more to it than that.
The PDF specification supports inclusion of JavaScripts within PDF documents. They can be triggered in various ways, including buttons, mouse-over, links, etc.
Adobe publishes JS API documentation at their site:
http://www.adobe.com/devnet/acrobat/javascript.html
The various documents describe how to use JS and how to include it in PDF documents.
Actually there's more to it than that.
The PDF specification supports inclusion of JavaScripts within PDF documents. They can be triggered in various ways, including buttons, mouse-over, links, etc.
Adobe publishes JS API documentation at their site:
http://www.adobe.com/devnet/acrobat/javascript.html
The various documents describe how to use JS and how to include it in PDF documents.
-
- User
- Posts: 40
- Joined: Tue Jun 01, 2010 9:03 pm
Re: Filling out a form programaticallty
Thanks for th elink - I've marked it to have a look at some point.
Paul
Paul
-
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
Re: Filling out a form programaticallty
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com