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

Possible to Extract/List All Template Names within a PDF-file?

New Here ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

Hi,

 

Is it possible to Extract All existing Template Names within a PDF-file (using Adobe Acrobat DC Pro)?

 

I'm working with a PDF-file with a Great number of Templates with different Names.

 

The reason that I'm asking because,

I'm spawning pages and Calls different ones if certain condition is met.

 

E.g.:

In one scenario these pages could spawned at once (some times many more could be spawned):

getTemplate("Job_1 of 100").spawn(this.numPages, false, false);

getTemplate("Mike_3 of 100").spawn(this.numPages, false, false);
getTemplate("Pluto_5 of 45").spawn(this.numPages, false, false);

 

I have a Custom-Made JavaSript "List All Fields" (purchased from Try67) which Extracts and List All Form Fields within a PDF-file, to a text-file (.txt). So I wonder if something similar can be done to extract Template names..?

 

So I guess I'm just wondering if somehow this could me managed E.g. by:

 

-JavaScript code?

-Returning this in the JavaScript Console?

-Custom-Made JavaScript Add-on?

 

Thanks in advance!

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms

Views

84

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 , Oct 01, 2024 Oct 01, 2024

Run the following script in the console:

var tmpl=this.templates;

for(var i=0;i<tmpl.length;i++)

{console.println(tmpl[i].name)}

Votes

Translate

Translate
Community Expert ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

Run the following script in the console:

var tmpl=this.templates;

for(var i=0;i<tmpl.length;i++)

{console.println(tmpl[i].name)}

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 ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

or simply type the single word "templates" on a line in the console and run it. 

 

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
New Here ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

LATEST

Thanks PDF Automation Station and Thom Parker for your solutions!
Highly appreciated!
They both worked like a charm 🙂

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