How do I open a PDF page via scripting ?

Advocate ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

I am extracting some layout information from PDF pages using ExtendScript in Illustrator. This works fine but as I need to automate the entire process, I am now looking for a method to open an existing PDF on a specified page in Illustrator from ExtendScript. The scripting reference just mentions the open( ) function with very little details on available options. Is there a more elaborate reference to be found somewhere?

If experienced scripters (or Adobe developers) know that my task is impossible to automate, please let me know so I can stop this wild goose chase before it eats up all my budget. But of course I would prefer finding a method to do what I intend to do.

TOPICS
How to , Import and export , Scripting

Views

67

Likes

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

Advocate , Dec 13, 2021 Dec 13, 2021
To open page 2 of the PDF file "pdf1" on my desktop:app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; var options1 = app.preferences.PDFFileOptions; options1.pageToOpen = 2; open(new File("~/Desktop/pdf1.pdf"), DocumentColorSpace.CMYK);

Likes

Translate

Translate
Advocate ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

To open page 2 of the PDF file "pdf1" on my desktop:

app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var options1 = app.preferences.PDFFileOptions;
options1.pageToOpen = 2;
open(new File("~/Desktop/pdf1.pdf"), DocumentColorSpace.CMYK);

 

Likes

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
Advocate ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

LATEST

In FrameMaker scripting the options for opening are passed in the Open( ) method, so I never looked at generic app properties for this. It works beautifully. Thanks a bundle.

Likes

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