Export to PNG saves as blank script Illustrator CS6
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);
}
Explore related tutorials & articles
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?
Copy link to clipboard
Copied
Hi. I have included the same.
Copy link to clipboard
Copied
your script works ok in both CC and CS6 here on Windows 10
Copy link to clipboard
Copied
But i have CS6 (16.3.2) it is saves as Blank png. It works wells in Illustrator 2020

