Photoshop JavaScript: options to open a PDF as smart object

戏子无情 提交于 2020-01-04 05:40:09

问题


I'm trying to open a PDF file as a smart object layer in Photoshop (CS5). Croped to the trimbox.

It works when using openDialog() and open().

But in case the property asSmartObject is true the PDFOpenOptions.cropPage = CropToType.TRIMBOX will be ignored.

There have to be options to open as smart object, like the PDFOpenOptions. But I can't find them, did you?

My page should be croped to the trimbox with a minimum height/width of 400 px. Open the PDF as rendered pic won't work, because PDFOpenOptions.height ist deprecated for CS5 (and newer).

I don't want to render with a higher resolution, the PDF could be a small business card or a huge poster. Opening a file should be fast. This is why I choosed "open as smart object".

var openPDF = File.openDialog (undefined, undefined, false);
var openPDFoptions = new PDFOpenOptions;
openPDFoptions.antiAlias = true;
openPDFoptions.bitsPerChannel = BitsPerChannelType.EIGHT;
openPDFoptions.cropPage = CropToType.TRIMBOX;
openPDFoptions.mode = OpenDocumentMode.RGB;
openPDFoptions.name = "unnamed";
openPDFoptions.page = 1;
openPDFoptions.resolution = 72;
openPDFoptions.suppressWarnings = true;
openPDFoptions.usePageNumber = true;
app.open (openPDF, openPDFoptions, false)

来源:https://stackoverflow.com/questions/38991330/photoshop-javascript-options-to-open-a-pdf-as-smart-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!