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

How to export selection in a doc as png?

Engaged ,
May 06, 2019 May 06, 2019

Copy link to clipboard

Copied

Hi,

I am working on a plugin for CC 2019 that can export selection on a document as png.

I looked into APIs in the C++ SDK similar to this API from the Scripting SDK,

app.activeDocument.exportSelectionAsPNG(fileSpec);

But, I couldn't find one.

There are only options to export the whole document.

Am I missing anything?

TOPICS
SDK

Views

566

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
Adobe
Community Beginner ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

Did you manage to solve your issue? I also am trying to do something similar but cannot find the right API call. 

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 ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

Hi,

 

No, couldn't find anything in the C++ SDK to do this.

In the end, I implemented this by hiding everything except the selection, resizing the artboard to the selection, and then exporting the document.

The end result was the desired result.

 

You'll have to handle different scenarios such as multiple artboards etc.

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
Explorer ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

LATEST

this works
app.activeDocument.exportSelectionAsPNG(File("C:/path/to/selection.png"));

Trying to set the resolution on this to 300ppi for a garment printer. 

Line taken from: 
https://community.adobe.com/t5/illustrator-discussions/how-to-do-quot-export-selection-quot-in-illus...

 

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