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

Raster resolution

Participant ,
Mar 22, 2018 Mar 22, 2018

Hi, I'm trying to create a script that will rasterize an object with certain resolution, but to no avail, what am I doing wrong, can anyone give me a hint?

#target illustrator

function rasterItem() {

    var sourceDoc = app.activeDocument;

    var currentItem = sourceDoc.pathItems[0]

    var resolucao = rasterizeOptions.resolution = (resolution / 72) * 400;

    currentItem.selected = true; 

    activeDocument.rasterize( currentItem, currentItem.visibleBounds, resolucao ); 

rasterItem();

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

Community Expert , Mar 22, 2018 Mar 22, 2018

function rasterItem() {

    var sourceDoc = app.activeDocument;

    var currentItem = sourceDoc.pathItems[0]

   

    var rasterOpts = new RasterizeOptions;

    rasterOpts.resolution = 96; //(resolution / 72) * 400;

    currentItem.selected = true;

    activeDocument.rasterize( currentItem, currentItem.visibleBounds, rasterOpts );

}

rasterItem();

Translate
Adobe
Community Expert ,
Mar 22, 2018 Mar 22, 2018

function rasterItem() {

    var sourceDoc = app.activeDocument;

    var currentItem = sourceDoc.pathItems[0]

   

    var rasterOpts = new RasterizeOptions;

    rasterOpts.resolution = 96; //(resolution / 72) * 400;

    currentItem.selected = true;

    activeDocument.rasterize( currentItem, currentItem.visibleBounds, rasterOpts );

}

rasterItem();

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 ,
Mar 22, 2018 Mar 22, 2018
LATEST

It worked perfectly, I did not know how to set the resolution option

Very thanks!

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