Copy link to clipboard
Copied
Hello,
when creating new pages from templates in PDF I have two options. Either all form fields get new names and therefore have individual data, or all fields keep their names and therefore get the content of fields with the same name.
What can I do with a template in which I want to have the same data in the header of each page (identical names of the fields), but also fields that should be individual?
Copy link to clipboard
Copied
I can think of a couple of options:
- Spawn the pages with unique field names but use a script so that those specific fields that you want to have the same value always copy their value from the original field.
- Do not put any fields on your Template pages and add the fields using a script after spawning a copy (this is going to be problematic in Reader, though).
Copy link to clipboard
Copied
Hello and thanks. I found a way to script it.
But I have an other problem. At the bottom I created a textfield for page numbers. The script looks as follows:
var dlst = this.getField("DropList1");
var tf = this.getField("DocPages");
var xval = 0;
var langs = new Array();
var AnzSeiten = this.numPages;
var DieseSeite = event.target.page + 1;
// Sprachtexte
langs[0] = "Seite " + DieseSeite + " von " + AnzSeiten ;
langs[1] = "Page " + DieseSeite + " of " + AnzSeiten ;
langs[2] = "Страница " + DieseSeite + " из " + AnzSeiten ;
xval = parseInt(dlst.value);
tf.value = langs[xval];
---------
Now, my problem ist that the pdf contents the first page and a hidden template. After opening the document, only the first page is present, but my textfield shows "Page 1 of 2" instead of "Page 1 of one".
What is wrong?
Thanks in advance.
Copy link to clipboard
Copied
Spawning a template can create a new page, it can also put fields over an existing page, so:
1. Spawn a new page from a template that renames the fields, as usual.
2. Spawn header fields, without renaming fields, from another template over the new created page.
You must use the bOverlay parameter: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJ...
Copy link to clipboard
Copied
This is what I do.
Some people have trouble creating a blank page that doesn't have a white background, but a simple way is to use the doc.newPage method via the JavaScript console to add a new blank page to the document, and then place the header fields on the resulting blank page, and then make it a hidden template.
Copy link to clipboard
Copied
I think JR has the best approach. Use two templates, one for the main (unique) form fields and one for the shared form fields.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more