Skip to main content
Participant
July 14, 2020
Question

Export to PNG saves as blank script Illustrator CS6

  • July 14, 2020
  • 2 replies
  • 627 views

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);

}

 

This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
July 14, 2020

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

Participant
August 1, 2020

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

femkeblanco
Legend
July 14, 2020

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?

Participant
August 1, 2020

Hi. I have included the same.