Photoshop文件选项
Photoshop文件选项
Section titled “Photoshop文件选项”preferences.photoshopFileOptions
用于打开 Photoshop 文件的选项,与 Application.open() 方法一起使用。所有属性均为可选。
PhotoshopFileOptions.parent
Section titled “PhotoshopFileOptions.parent”preferences.photoshopFileOptions.parent
此对象的父对象。
对象;只读。
PhotoshopFileOptions.pixelAspectRatioCorrection
Section titled “PhotoshopFileOptions.pixelAspectRatioCorrection”preferences.photoshopFileOptions.pixelAspectRatioCorrection
如果为 true
,则应调整具有非正方形像素宽高比的导入图像。
布尔值
PhotoshopFileOptions.preserveImageMaps
Section titled “PhotoshopFileOptions.preserveImageMaps”preferences.photoshopFileOptions.preserveImageMaps
如果为 true
,则在文档转换时应保留图像映射。
默认值:true
布尔值
PhotoshopFileOptions.preserveLayers
Section titled “PhotoshopFileOptions.preserveLayers”preferences.photoshopFileOptions.preserveLayers
如果为 true
,则在文档转换时应保留图层。
默认值:true
布尔值
PhotoshopFileOptions.preserveSlices
Section titled “PhotoshopFileOptions.preserveSlices”preferences.photoshopFileOptions.preserveSlices
如果为 true
,则在文档转换时应保留切片。
默认值:true
布尔值
PhotoshopFileOptions.typename
Section titled “PhotoshopFileOptions.typename”preferences.photoshopFileOptions.typename
引用对象的类名。
字符串;只读。
打开 Photoshop 文件
Section titled “打开 Photoshop 文件”// 打开一个包含图层的 Photoshop 文件,// 并设置首选项以保留图层var psdOptions = preferences.photoshopFileOptions;psdOptions.preserveLayers = true;psdOptions.pixelAspectRatioCorrection = false;
// 使用这些首选项打开文件var fileRef = File(psdFilePath);if (fileRef != null) { var docRef = open(fileRef, DocumentColorSpace.RGB);}