Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
9

Modify Spawned Pages based on Template

Explorer ,
Aug 10, 2023 Aug 10, 2023

Hi,

I have a question regarding the spawned pages based on a template page.

Let's say I have a PDF with a template page (template) already created, and have the fields listed below already filled in for the template page:

"TemplateField1, TemplateField2, TemplateField3"

And I have generated the following pages based on the template page:

"TemplateP1, TemplateP2"

And now I want to use this PDF for another job (same template page anyway), and those pre-filled fields have to be modified to suit the new job. I can rectify the template page to make sure the newly spawned pages carry out the changes I made to the fields, but what script can I put in to make sure the two pages spawned "TemplateP1, TemplateP2" for the previous job will have the changes made for the new job reflected in the fields "TemplateField1, TemplateField2, TemplateField3"?

 

Thanks very much!

TOPICS
JavaScript , PDF forms
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Aug 11, 2023 Aug 11, 2023

The answer is no. Once spawned, the pages are independent of the Template. The only changes that will propagate to them is if you change the fields on the Template page, and have defined it so that the fields on the spawned pages are not renamed, meaning they are copies of the original ones. And even then not all changes will be copied over. For example, you can set different copies of the same text field to have different fonts, but if you set one of them as read-only, they will all become read-only.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2023 Aug 10, 2023

Script to spawn template is always same, you can only change condition to spawn them.

You can make changes to the template and hide it again, changes will be saved.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 10, 2023 Aug 10, 2023

Thanks, but will the changes made to the template reflect on the previously spawned pages?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2023 Aug 10, 2023

What exactly are the changes?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 10, 2023 Aug 10, 2023

Sorry, did not make it clear enough.

Let's say for the template page field "TemplateField1", I filled in "ABC", and all the spawned pages all have "ABC" pre-filled in. Now I want to change it to "DEF" in "TemplateField1" for the template page, and how can the DEF gets reflected in the previously generated pages, even though the change will carry out into the newly spawned pages from here. Does it make any sense? Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2023 Aug 10, 2023

If I understand you right, you can use this in each field on template to show value from "TemplateField1":

event.value = this.getField("TemplateField1").value;

and save template with those scripts.

Once you made changes to "TemplateField1" it should be reflected in fields in the spawned template.

Keep in mind, if you make changes before spawning template, spawning template will not trigger script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2023 Aug 11, 2023

The answer is no. Once spawned, the pages are independent of the Template. The only changes that will propagate to them is if you change the fields on the Template page, and have defined it so that the fields on the spawned pages are not renamed, meaning they are copies of the original ones. And even then not all changes will be copied over. For example, you can set different copies of the same text field to have different fonts, but if you set one of them as read-only, they will all become read-only.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 13, 2023 Aug 13, 2023
LATEST

Thanks very much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines