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)