ExportOptionsJPEG
ExportOptionsJPEG
Section titled “ExportOptionsJPEG”exportOptionsJPEG
将文档导出为 JPEG 文件的选项,与 Document.exportFile() 方法一起使用。所有属性都是可选的。
导出文档时,会自动附加适当的文件扩展名。您不应在文件规范中包含任何文件扩展名。
ExportOptionsJPEG.antiAliasing
Section titled “ExportOptionsJPEG.antiAliasing”exportOptionsJPEG.antiAliasing
如果为 true
,导出的图像应进行抗锯齿处理。
默认值:true
。
布尔值。
ExportOptionsJPEG.artBoardClipping
Section titled “ExportOptionsJPEG.artBoardClipping”exportOptionsJPEG.artBoardClipping
如果为 true
,导出的图像应裁剪到画板。
布尔值。
ExportOptionsJPEG.blurAmount
Section titled “ExportOptionsJPEG.blurAmount”exportOptionsJPEG.blurAmount
应用于导出图像的模糊量。
范围:0.0 到 2.0。
默认值:0.0。
数字(双精度)。
ExportOptionsJPEG.horizontalScale
Section titled “ExportOptionsJPEG.horizontalScale”exportOptionsJPEG.horizontalScale
应用于导出图像的水平缩放因子,其中 100.0 表示 100%。
默认值:100.0。
数字(双精度)。
ExportOptionsJPEG.matte
Section titled “ExportOptionsJPEG.matte”exportOptionsJPEG.matte
如果为 true
,画板应使用颜色进行遮罩处理。
默认值:true
。
布尔值。
ExportOptionsJPEG.matteColor
Section titled “ExportOptionsJPEG.matteColor”exportOptionsJPEG.matteColor
用于遮罩画板的颜色。
默认值:white
。
ExportOptionsJPEG.optimization
Section titled “ExportOptionsJPEG.optimization”exportOptionsJPEG.optimization
如果为 true
,导出的图像应针对网页浏览进行优化。
默认值:true
。
布尔值。
ExportOptionsJPEG.qualitySetting
Section titled “ExportOptionsJPEG.qualitySetting”exportOptionsJPEG.qualitySetting
导出图像的质量。
范围:0 到 100。
默认值:30。
数字(长整型)。
ExportOptionsJPEG.saveAsHTML
Section titled “ExportOptionsJPEG.saveAsHTML”exportOptionsJPEG.saveAsHTML
如果为 true
,导出的图像应保存为附带 HTML 文件。
默认值:false
。
布尔值。
ExportOptionsJPEG.typename
Section titled “ExportOptionsJPEG.typename”exportOptionsJPEG.typename
引用对象的类名。
字符串;只读。
ExportOptionsJPEG.verticalScale
Section titled “ExportOptionsJPEG.verticalScale”exportOptionsJPEG.verticalScale
应用于导出图像的垂直缩放因子。
范围:0.0 到 776.19。
默认值:100.0。
数字(双精度)
导出为 JPEG 格式
Section titled “导出为 JPEG 格式”// 将当前文档导出为 JPEG 文件到 dest,使用指定的选项,// dest 包含完整路径,包括文件名
function exportFileToJPEG(dest) { if (app.documents.length > 0) { var exportOptions = new ExportOptionsJPEG(); exportOptions.antiAliasing = false; exportOptions.qualitySetting = 70;
var type = ExportType.JPEG; var fileSpec = new File(dest);
app.activeDocument.exportFile(fileSpec, type, exportOptions); }}