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

Having trouble remembering how to create form template and spawning additional pages

Explorer ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

I have a form I created a few years ago where a user clicks on the last page, and it will spawn additional copies of that last page in case more information is required.

 

However, now they want that last page to be its own document, and for the life of me I can't remember how to save a pdf as a template. All the help forums say

1) Make form

2) Save as Template

3) Profit

It's how to actually "save" as a template that I'm getting hung up on. Can't find it in the Tools, Export, or Save As menus anywhere.

I think once I get past that, and figure out how to hide the template, I can redo the JavaScript for the spawing part.

var a = this.getTemplate("addprojects");
a.spawn({nPage: this.numPages, bRename: true, bOverlay: false});

Please can someone help?

TOPICS
JavaScript , PDF forms

Views

126

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Dec 13, 2022 Dec 13, 2022

The word "template" can be confusing because it can mean lots of different things. Posters often talk about using a whole PDF as a template.  But there is no concept of a whole PDF template in Acrobat. In the context of Acrobat and the PDF specification, only pages can be made into page templates. This is nothing to do with saving the PDF.

 

To make a document from the last page and maintain the page template action, save the PDF to a diffent name and then delete all the other pages. Do a SaveAs

...

Votes

Translate

Translate
Community Expert ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

The word "template" can be confusing because it can mean lots of different things. Posters often talk about using a whole PDF as a template.  But there is no concept of a whole PDF template in Acrobat. In the context of Acrobat and the PDF specification, only pages can be made into page templates. This is nothing to do with saving the PDF.

 

To make a document from the last page and maintain the page template action, save the PDF to a diffent name and then delete all the other pages. Do a SaveAs to clean it up, and your done.

 

 

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

Votes

Translate

Translate

Report

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 ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

I think I understand about the templates, but I'm having trouble making the JavaScript work.

Let's say my document is called "Disclosure Form" how should the JS go?

 

 

Votes

Translate

Translate

Report

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 ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

Never mind, I think I got it.

Votes

Translate

Translate

Report

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 ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

LATEST

The code you've shown above "spawns" a single page from a page template named "addprojects".  There is no relationship file name. 

Pages are turned into named templates from the page template dialog, which in Acrobat DC can be found on the "Organize Pages" tools.  

 

PageTemplateCreation.jpg

 

 

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

Votes

Translate

Translate

Report

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