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!
Run the following script in the console:
var tmpl=this.templates;
for(var i=0;i<tmpl.length;i++)
{console.println(tmpl[i].name)}
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)}
Copy link to clipboard
Copied
or simply type the single word "templates" on a line in the console and run it.
Copy link to clipboard
Copied
Thanks PDF Automation Station and Thom Parker for your solutions!
Highly appreciated!
They both worked like a charm 🙂