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

Save multiple artboards to individual PDFs... All artboards still exist in AI

Community Beginner ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

I'm rewriting some export scripts of mine and I've just come across something strange...

Part of my multi-export script saves a PDF for each artboard. The code looks something like this:

  for ( var i = starting_artboard; i < num_artboards; i++ ) {

    starting_artboard = doc.artboards.setActiveArtboardIndex(i);

    var saveOptions = new PDFSaveOptions();

    saveOptions.compatibility = PDFCompatibility.ACROBAT6;

    saveOptions.generateThumbnails = true;

    saveOptions.preserveEditability = true;

    saveOptions.artboardRange = i+1;

    doc.saveAs( dest, saveOptions );

  }

Now, this works perfectly, and I get a PDF for each artboard... until I open one of those PDFs back up in Illustrator and all the artboards are still there. So each PDF has all the artboards (not just the content of the artboards, but the actual artboards, still named and placed as they were). Weirdly the artboards don't exist *anywhere* else. They don't exist if I open the PDFs in Acrobat, Photoshop, any random PDF viewer, anywhere; only in Illustrator.

Any idea why and how I can fix this? I'm hoping I'm missing something obvious and I don't have to copy the artboard to a new temp doc and save that, but I can't find anything in PDFSaveOptions that should be causing this.

TOPICS
Scripting

Views

2.0K

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

Valorous Hero , Feb 22, 2017 Feb 22, 2017

It's probably the territory coming along with "preserveEditability" being true, try doing without it if you're able to.

Votes

Translate

Translate
Adobe
Valorous Hero ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

It's probably the territory coming along with "preserveEditability" being true, try doing without it if you're able to.

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
Community Beginner ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

Yup, works perfectly. Like I said "...missing something obvious"

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
Contributor ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Hey Cai,

Your script looks interesting! Would you know if it would be possible to use the names of the artboards as the names of the exported files? see screenshot (sorry in dutch, tekengebieden is artboards). Thanks in advance! Stefaan

Schermafbeelding 2017-06-19 om 09.16.00.png

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
Valorous Hero ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Yea it's possible:
doc.saveAs( destFolder + "/" + doc.artboards.name + ".ai", saveOptions ); 

I think.

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
Contributor ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

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
Valorous Hero ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Ha it probably did not work, because the destination part should have been wrapped in a File() constructor.

But, here's an idea  - the multi artboard export scripts are neat, but have they not been now replaced by the native Artboard Exporter feature?

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
Contributor ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

yep, but the main issue was that i wanted to use the same naming as the artboards names… and it does in this script.

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
Valorous Hero ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

LATEST

The new asset exporter uses artboard names, and you can add prefix/suffix as well as scaling.

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