Skip to main content
Participating Frequently
June 20, 2019
Question

Deleting specific templates (not pages)

  • June 20, 2019
  • 2 replies
  • 2807 views

Is there a way to delete specific templates without any reference to pages?

Currently on my set up i have options to spawn templates with no preferred order (as intended) and this results in the templates possibly spawning on different pages, depending on the user. (current code is a simple a.spawn({nPage: this.numPages, bRename: true, bOverlay: false}); on all my checkboxes)

However, i also want to give the user an option to remove the template as well. My current knowledge of deleting templates only consists of this.deletePages(). To the best of my knowledge, this deletes specific pages, not templates, which is what i want. Is there a code snippet that target specific templates instead of pages?

This topic has been closed for replies.

2 replies

Inspiring
June 20, 2019

If you want to do that, make the template page hidden, and generate what you now have as a visible page that is a template by spawning the hidden template.

Participating Frequently
June 20, 2019

yes, this is exactly what i am doing now. I have 7 pages in total, 6 of which are templates and hidden. The first page is an introduction and is where the checkboxes are for them to spawn and delete the 6 different sections (in any order they want).

However i cannot find a method to delete the pages that is specific to the particular section. If user 1 spawns the Sections in the sequence A B C D E F (in order from page 2 - 7), compared to user 2 who spawns Sections in the sequence B F D A C E (in order from page 2-7), i need a method to accurately delete Section C, for example, when both users click "Remove Section C" on page 1.

My current code this.deletePages() cannot target Section C, for example. I can set it to delete page 4, but that'll only work for user 1, and not user 2.

Bernd Alheit
Community Expert
Community Expert
June 20, 2019

Acrobat Reader can only delete spawned pages.

Participating Frequently
June 20, 2019

I'm using acrobat pro, if it helps.

Perhaps i could elaborate a little more. I created a few templates that i named it SectionB, C, etc. However, the order of which they are opened are not specified, which means that a user can click to open Section C before Section B (on page 1 where all the checkbox fields are), resulting in page 2 being Section C and page 3 being Section B.

However, i also want to have the option to delete the Sections that were spawned as well. Because of the unspecified order that the Sections are opened (Section B can be on page 2 or 3 or whatever order the user opened it), i can never accurately delete a specified Section. If the user opens Section B, and wants to delete it after, a command to delete the page will never work because the particular section may not spawn at the same page every time.

I hope i made sense, really need some advice on this..

Participating Frequently
June 20, 2019

In a hidden text field on the template page you can save the section name. When the user wants delete Section B you can find all spawned pages of Section B.


Sorry, i don't really understand what you are trying to say here. How would the user delete section B from the template page? I want the page to be deleted from a checkbox on page 1, not from the template page.