Skip to main content
GatsbyNZ
Known Participant
July 5, 2023
Question

Need Script for Template Page

  • July 5, 2023
  • 2 replies
  • 415 views

Hi,

I have a question for the Template Page.

Let's say I created a few pages based on the template page and all the fields on the generated pages are filled in, and one day I want to duplicate this PDF for another purpose and therefore need to correct the information on the template page (there is some general information prefilled in), what extra script do I need to make sure that the changes I make to those fields on the template page will carry out through to those generated pages? 

 

Thanks very much.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
July 5, 2023

You don't need any script. Just make the Template page visible, make the changes to the fields, then hide it and save the file.

Thom Parker
Community Expert
Community Expert
July 5, 2023

When fields are renamed on the spawned pages, they are renamed using a prefix. The root field name stays the same. You could write a script to look through all the fields for ones with a particular root name and then change those accordingly. 

 

Another option is to change the original document to use two templates.  One template is the spawned page with renamed fields. The second template contians the fields that are the same on every new page.  This template is overlaid on top of the spawned page with the setting that does not change the field names. Now you can change the data in one of the common fields and it is automatically propagated to the other pages.  

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often