Skip to main content
Piotr Smolen
Inspiring
January 3, 2023
Question

Page template - life cycle

  • January 3, 2023
  • 2 replies
  • 2207 views

I'm trying to understand how templates work in pdf forms.
The tests show that the template created on the basis of the page exists only together with the page on the basis of which it was created.
For example, I created a document whose page 2 (empty without any texts or controls) served as a template to create a template :-).
I created a template from the console level and everything is OK. I can add it "spawn" with a script any number of times to the document, I can do something with scripts on these new pages. But if I delete page 2 right after creating the template, the template is automatically deleted as well. What am I doing wrong?

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
January 3, 2023
Piotr Smolen
Inspiring
January 3, 2023

What is LCD form?

This is a regular form created with Adobe Acrobat Pro if that's what you're asking.

Legend
January 3, 2023

There are two types of PDF forms (well, more actually). They have different JavaScript APIs.

- Acrobat forms (also Acroform)

- XFA forms (also Designer forms, AEM forms, XML forms, LiveCycle Designer forms, LCD forms)

Many people don't notice the "V" in LiVeCycle and call them LifeCycle forms. Hence the need to clarify. 

Bernd Alheit
Community Expert
Community Expert
January 3, 2023

When you use page 2 as template page don't delete page 2. Page 2 is the template page.

Piotr Smolen
Inspiring
January 3, 2023

Hmm, that's a bit of a problem. I can't add a blank page from within the script. I also cannot manipulate static content (plain text) from within the script. I can't hide the page that is the basis of the template (I'm wrong?).
So how to create a document, a perfect example is an invoice, where I have some header part with static elements, a table with a variable number of rows, maybe on many pages, with details about the invoice items, then I have another small table summarizing the amounts, and a footer of the document ( not to be confused with the footer of the page) in which I also have static texts and dynamically calculated fields and e.g. QR codes for bank payments?
So is it even possible to do it using scripts and Adobe DC or Adobe Pro?
And all I want is how to add a blank page from the script...

Bernd Alheit
Community Expert
Community Expert
January 3, 2023

You can hide the template page.