Photoshop opening PDFs

Post Reply
aoswood
Member
Posts: 20
Joined: Wed Sep 14, 2011 6:16 pm

Photoshop opening PDFs

Post by aoswood »

I am using the Photoshop configurator to open PDFs and rasterize them on difficult jobs. My issue is by default Photoshop selects bounding Box for the Crop too. If I open a PDF manually and change it to Media Box, all files there after will use that setting. Of course if Photoshop is closed it goes back to the default.



I found a Javascript for opening the file but I don't believe it is complete and doesn't run in SWITCH when I try in my Open with Script in the Photoshop configurator. I am sure I need to provide more info.



var pdfOpenOptions = new PDFOpenOptions();



pdfOpenOptions.antiAlias = true;

pdfOpenOptions.mode = OpenDocumentMode.RGB;

pdfOpenOptions.bitsPerChannel = BitsPerChannelType.EIGHT;

pdfOpenOptions.resolution = 300;

pdfOpenOptions.supressWarnings = true;

pdfOpenOptions.cropPage = CropToType.MEDIABOX;



Thanks

Andy
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Photoshop opening PDFs

Post by freddyp »

When using a script to open/create a file you also have to open or create the file. You were only setting the options with which to open a PDF, but you were not opening it. Just add these two lines:



var infile = new File($infile);

app.open(infile, pdfOpenOptions);



$infile is the path to the input file that Switch passes to the Photoshop Javascript. That is documented in the help in the chapter "Javascript for applications".



Freddy
aoswood
Member
Posts: 20
Joined: Wed Sep 14, 2011 6:16 pm

Photoshop opening PDFs

Post by aoswood »

Thank you that worked perfectly.



I will definitely be doing more with Javascripts and the Adobe Suite.



Thanks

Andy
Post Reply