Copy link to clipboard
Copied
Good evening,
I have 2 questions re: spawning templates in a pdf. Below is the code I have attached to a button in the document:
var interview1 = this.getTemplate ("interview1");
var interview2 = this.getTemplate ("interview2");
var interview3 = this.getTemplate ("interview3");
var interview4 = this.getTemplate ("interview4");
var interview5 = this.getTemplate ("interview5");
var interview6 = this.getTemplate ("interview6");
interview1.spawn();
interview2.spawn();
interview3.spawn();
interview4.spawn();
interview5.spawn();
interview6.spawn();
getField ("interview1.LAST_NAME").setFocus();
Currently when I click the button, it loads a 6 page interview form to the END of the pdf.
Question 1) How do I get it to load to the BEGINNING of the document?
Question 2) How do I get already filled out fields from the core pdf to auto-populate into the spawned template? For example, an individual already fills out first name, last name, etc. fields into the document prior to me spawning the template. Right now I have to manually retype their name. How can I change it to autopull from the core pdf?
Thanks!
1.
this.getTemplate("interview1").spawn(0, true, false);
You should read this for more infos: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/Acro12_MasterBook/JS_API_AcroJS/Template_methods.htm?rhhlterm=spawn&rhsyns=%20
2.
Two solutions:
- use exactly the same for fields that must share their content.
- use a script that replicate the "master" field content to others.
3.
You should not use the same name for a variable and a template.
Copy link to clipboard
Copied
1) Look at the parameters of the method spawn
Copy link to clipboard
Copied
1.
this.getTemplate("interview1").spawn(0, true, false);
You should read this for more infos: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/Acro12_MasterBook/JS_API_AcroJS/Te...
2.
Two solutions:
- use exactly the same for fields that must share their content.
- use a script that replicate the "master" field content to others.
3.
You should not use the same name for a variable and a template.
Copy link to clipboard
Copied
3) Why not?
Copy link to clipboard
Copied
This question was already answered: https://community.adobe.com/t5/acrobat/custom-calculation-script-for-if-else-if/m-p/11821823
And because this is confusing for humain brains too.
Copy link to clipboard
Copied
The question was not answered.
Copy link to clipboard
Copied
Can't you read the OP answer? : "You are awesome! It worked. Thank you so much."
Copy link to clipboard
Copied
This was not a reply to your posting!