Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Change Export Raster Resolution?

$
0
0

Hello,

I am trying to use JavaScript to export layers to PNG... I have a working script, that is basically the same as the example in the Adobe Illustrator CS5 JavaScript Reference:

 

function exportFileToPNG24 (dest) {     if ( app.documents.length > 0 ) {          var exportOptions = new ExportOptionsPNG24();          var type = ExportType.PNG24;          var fileSpec = new File(dest);          exportOptions.antiAliasing = false;          exportOptions.transparency = false;          exportOptions.saveAsHTML = true;          app.activeDocument.exportFile( fileSpec, type, exportOptions );     }
}

 

However, this will only export the document to 72ppi, and I don't see anywhere in ExportOptionsPNG24 to change this.

If you use Illustrator's UI, instead of scripting, and select File > Export... You get the option to select Screen (72ppi), Medium (150ppi), High (300ppi) or Other.

I found the DocumentRasterResolution constant in the reference, but I can't figure out how to change, or even access the constant?

I assume if I could reset the constant like:

 

DocumentRasterResolution = 3;

 

then the above script would export the file to a PNG @ 300 ppi?


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>