Skip to content

ExportOptionsPNG24

exportOptionsPNG24

Options for exporting a document as a 24-bit PNG file, used with the Document.exportFile() method. All properties are optional.

When you export a document, the appropriate file extension is appended automatically. You should not include any file extension in the file specification.


exportOptionsPNG24.antiAliasing

If true, the exported image be anti-aliased.

Default: true.

Boolean.


exportOptionsPNG24.artBoardClipping

If true, the exported image be clipped to the art board.

Default: false.

Boolean.


exportOptionsPNG24.horizontalScale

The horizontal scaling factor to apply to the exported image, where 100.0 is 100%.

Default: 100.0.

Number (double).


exportOptionsPNG24.matte

If true, the art board be matted with a color.

Default: true.

Boolean.


exportOptionsPNG24.matteColor

The color to use when matting the art board.

Default: white.

RGBColor


exportOptionsPNG24.saveAsHTML

If true, the exported image be saved with an accompanying HTML file.

Default: false.

Boolean.


exportOptionsPNG24.transparency

If true, the exported image use transparency.

Default: true.

Boolean.


exportOptionsPNG24.typename

The class name of the referenced object.

String; read-only.


exportOptionsPNG24.verticalScale

The vertical scaling factor to apply to the exported image, where 100.0 is 100.

Default: 100.0.

Number (double).


// Exports current document to dest as a PNG24 file with specified options,
// dest contains the full path including the file name,
// saveAsHTML option creates an HTML version with the PNG file in an images folder
function exportFileToPNG24(dest) {
if (app.documents.length > 0) {
var exportOptions = new ExportOptionsPNG24();
exportOptions.antiAliasing = false;
exportOptions.transparency = false;
exportOptions.saveAsHTML = true;
var type = ExportType.PNG24;
var fileSpec = new File(dest);
app.activeDocument.exportFile(fileSpec, type, exportOptions);
}
}