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

Best way to count PDF Pages in Illustrator Script

New Here ,
Nov 07, 2018 Nov 07, 2018

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?

TOPICS
Scripting

Views

1.1K

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

Engaged , Nov 08, 2018 Nov 08, 2018

What version of Illustrator are you using?

The latest version of Illustrator will open multiple page PDFs...

Capture.PNG

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.

http://aiscripts.com/

Then my script would work.

Votes

Translate

Translate
Adobe
Engaged ,
Nov 07, 2018 Nov 07, 2018

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");

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 ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

This will always return 1 as you can only open one PDF page at once

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
Engaged ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

What version of Illustrator are you using?

The latest version of Illustrator will open multiple page PDFs...

Capture.PNG

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.

http://aiscripts.com/

Then my script would work.

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 ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

LATEST

Thx! Yes I'm working with Illustrator CS6.

Sadly the link returns 404.

Here is an extended version of the script:

ExtendScripts4AI-ID/AI_Multi-Page PDF Loader 4 AI v2.5.jsx at master · arnaudin/ExtendScripts4AI-ID ...

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