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

Get and set artboard of placed item

Mentor ,
Jan 25, 2018 Jan 25, 2018

Hi all,

when I manually place an AI/PDF file, the PDF import options dialog allows to specify a page or artboard of the imported file. Is there a way to do the same by script, and/or later on retrieve the value?

I've already tried:

  • matching properties of placedItem
  • parameters for relink()
  • PDF import options
  • tags

Regards,

Dirk

TOPICS
Scripting
839
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

correct answers 1 Correct answer

People's Champ , Jan 25, 2018 Jan 25, 2018

Hello,

Nothing straightforward as it seems 😕 Only things I could think of is:

a) open the file aside, set active artboard, duplicate items to new Document (if possible)

b) Open doc with PDFFileOptions/pageToOpen

saves a tempFile

either use createFromFile (tempFile) or placedItems.add().file = …

Hoping there is a better way,

FWIW

Loic

Translate
Adobe
People's Champ ,
Jan 25, 2018 Jan 25, 2018

Hi Dirk,

app.PDFPlacePreferences.pageNumber

Does that not work?

Ariel

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
Mentor ,
Jan 25, 2018 Jan 25, 2018

Hi Ariel,

if this were InDesign, sure.

I'm looking for the equivalent in Illustrator, drawing icons with InDesign feels a little odd ...

Thanks,

Dirk

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
People's Champ ,
Jan 25, 2018 Jan 25, 2018

Oops -- didn't notice which forum we were in!

Sorry, then, I have no idea! Hopefully someone else will chip in here and share their expertise.

Ariel

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
People's Champ ,
Jan 25, 2018 Jan 25, 2018

Hello,

Nothing straightforward as it seems 😕 Only things I could think of is:

a) open the file aside, set active artboard, duplicate items to new Document (if possible)

b) Open doc with PDFFileOptions/pageToOpen

saves a tempFile

either use createFromFile (tempFile) or placedItems.add().file = …

Hoping there is a better way,

FWIW

Loic

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 ,
Jan 25, 2018 Jan 25, 2018

what loic said, use pageToOpen, here's a link to a working script

 

How to "Place as linked file" (not "import") a multipage PDF file on a single Artboard ?

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
People's Champ ,
Jan 25, 2018 Jan 25, 2018

If I can help the great Dirk Becker​ once in my lifetime, I will be happy to pay back a little for all the generous help he provided to me over the years

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
Mentor ,
Jan 25, 2018 Jan 25, 2018

Thanks all, I'll give it a try. PDFFileOptions plus an action.

Here comes the next problem - the placed file name will be hard-wired in the action.

Solvable with a following relink(), the page number is preserved.

Hmm.

Now I also retried the previous approach - et voilà, placedItems.add().file will honour the setting, no need for an action!

Sorry Carlos, I had set the "Correct" flag too early because going thru an action sounded too compelling Illustrator-ish.

Thanks a lot, Loic.

I see I'll have still much to learn with Illustrator.

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
Valorous Hero ,
Jan 26, 2018 Jan 26, 2018
LATEST

So all you have to do is set the preference and do placed item add? Maybe I have done this before, but my memory is very distant if any on that one time.

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