Highlighted

Export to PNG saves as blank script Illustrator CS6

New Here ,
Jul 14, 2020

Copy link to clipboard

Copied

I have the below script to export as PNG. It works well in CC, but when performed in Illustrator CS6, it saves as blank PNG file. No contents are appearing.

 

 

function exportToPNGFile(locToSave) {
var doc = app.activeDocument;
var exportOptions= new ExportOptionsPNG24 ();
var type= ExportType.PNG24;
var fileSpec= new File(locToSave);

exportOptions.artBoardClipping = false;
exportOptions.antiAliasing= false;
exportOptions.transparency= false;
exportOptions.horizontalScale = 100.0;
exportOptions.verticalScale = 100.0;

doc.exportFile(fileSpec, type, exportOptions);

}

 

TOPICS
Import and export, Scripting

Views

73

Likes

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

Export to PNG saves as blank script Illustrator CS6

New Here ,
Jul 14, 2020

Copy link to clipboard

Copied

I have the below script to export as PNG. It works well in CC, but when performed in Illustrator CS6, it saves as blank PNG file. No contents are appearing.

 

 

function exportToPNGFile(locToSave) {
var doc = app.activeDocument;
var exportOptions= new ExportOptionsPNG24 ();
var type= ExportType.PNG24;
var fileSpec= new File(locToSave);

exportOptions.artBoardClipping = false;
exportOptions.antiAliasing= false;
exportOptions.transparency= false;
exportOptions.horizontalScale = 100.0;
exportOptions.verticalScale = 100.0;

doc.exportFile(fileSpec, type, exportOptions);

}

 

TOPICS
Import and export, Scripting

Views

74

Likes

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
Jul 14, 2020 0
Engaged ,
Jul 14, 2020

Copy link to clipboard

Copied

It works fine for me in CS6.  Please excuse the obvious question:  There is no function call in the above snippet; you are calling the function exportToPNGFile("your path..."), aren't you?

Likes

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
Reply
Loading...
Jul 14, 2020 0
New Here ,
Aug 01, 2020

Copy link to clipboard

Copied

Hi. I have included the same.

Likes

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
Reply
Loading...
Aug 01, 2020 0
Adobe Community Professional ,
Jul 14, 2020

Copy link to clipboard

Copied

your script works ok in both CC and CS6 here on Windows 10

Likes

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
Reply
Loading...
Jul 14, 2020 0
New Here ,
Aug 01, 2020

Copy link to clipboard

Copied

But i have CS6 (16.3.2) it is saves as Blank png. It works wells in Illustrator 2020

Likes

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
Reply
Loading...
Aug 01, 2020 0
Resources