Photoshop 脚本:无法设置“另存为 PDF”选项

问题描述

我正在尝试使用扩展脚本将 Adob​​e Photoshop 文件保存为 PDF。我想将 PDF 兼容性设置为 Acrobat 6 并将编码设置为 zip。当我指定这些设置时,我收到了如下脚本注释中所示的错误。我做错了什么?

#target photoshop

if (documents.length > 0) {
    var saveOptions = new PDFSaveOptions();
  
    // This throws "PDFCompatibilityType is undefined" 
    saveOptions.PDFCompatibility = PDFCompatibilityType.PDF15; // Acrobat 6 or higher
  
    // These throw "Undefined is not an object" 
    saveOptions.PDFCompatibility = PDFSaveOptions.PDFCompatibilityType.PDF15; // Acrobat 6 or higher
    saveOptions.PDFCompatibility = saveOptions.PDFCompatibilityType.PDF15; // Acrobat 6 or higher
  
    // This throws "Enumerated Value Expected" 
    saveOptions.PDFCompatibility = 3; // Acrobat 6 or higher
  
    // Same problems with these settings
    // saveOptions.PDFStandard = PDFStandardType.NONE;
    // saveOptions.downSample = PDFResampleType.PDFBICUBIC;
    // saveOptions.encoding = PDFEncodingType.PDFZIP;

    // Save as PDF
    var f = new File( "~/Desktop/SAVE_TEST.pdf" );
    app.activeDocument.saveAs( f,saveOptions,true,Extension.LOWERCASE );
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)