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

Latest object model fully support Multi-page PDF Importing?

New Here ,
Dec 01, 2021 Dec 01, 2021

Hi all, Illustrator has a decent Multi-page PDF import function at the moment.

But I could not figure out how to do this with the script(app.preferences.PDFFileOptions) to import multi pages at once, instead of one by one.

Could anyone please help?

 

Thank you.

 

TOPICS
Scripting
367
Translate
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
Adobe
Community Expert ,
Dec 02, 2021 Dec 02, 2021

try this script

app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

var pdfOptions = app.preferences.PDFFileOptions;
pdfOptions.pageRangeToOpen = "1-2"; // or "all"

var idoc = app.open(File("C:/Users/canto/Google Drive/Adobe Scripts/illustrator_CS6_QuickStart_Guide.pdf")); // full path to your pdf

app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
Translate
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 ,
Dec 07, 2021 Dec 07, 2021

It works fine.

Thank you very much.

Translate
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 ,
Dec 08, 2021 Dec 08, 2021

glad to hear it helped

Translate
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
Participant ,
Apr 02, 2024 Apr 02, 2024

Carlos, very sorry, bother you in here.  variable is "all", so after open pdf,  it will be generated clipping mask.  but variable is number(1-2), it is OK. why ?

ruihuang_0-1712108590842.pngexpand image

 

Translate
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 ,
Apr 03, 2024 Apr 03, 2024

@rui huang that's the default behavior, when pageToOpen is "all", the pdf opens as Links. When you open a "range", ie "1-3" the pdf opens Embedded.

 

you can change the default by explicitly setting the the following property

pdfOptions.placeAsLinks = false; // false = embed, true = link
Translate
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
Participant ,
Apr 04, 2024 Apr 04, 2024
LATEST

Beyond words to thank

Translate
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