Copy link to clipboard
Copied
Hi!
I'm trying to count the total Page amount of a PDF File in JavaScript but haven't found any decent solution so far.
Any ideas?
What version of Illustrator are you using?
The latest version of Illustrator will open multiple page PDFs...
Since you are most likely on an older version of Illustrator you can use the open multiple page pdfs script....
It opens all the pages of a PDF on individual artboards.
Then my script would work.
Copy link to clipboard
Copied
You could just have it count the art boards...then alert you
alert("There are " + app.activeDocument.artboards.length + " pages");
Copy link to clipboard
Copied
This will always return 1 as you can only open one PDF page at once
Copy link to clipboard
Copied
What version of Illustrator are you using?
The latest version of Illustrator will open multiple page PDFs...
Since you are most likely on an older version of Illustrator you can use the open multiple page pdfs script....
It opens all the pages of a PDF on individual artboards.
Then my script would work.
Copy link to clipboard
Copied
Thx! Yes I'm working with Illustrator CS6.
Sadly the link returns 404.
Here is an extended version of the script: