Skip to main content
Known Participant
May 9, 2022 1:48 PM UTC
Question

PDF import in photoshop

Hi All,

I am using the below code for import the PDF into Photoshop. It is working fine with 72 resolution and produce the correct output. But if we fix for 400 resolution, script produce the wrong output (image stretched vertically).
Please do the needful to get correct output and 400 resolution.
Thanks!

var inputFiles = File.openDialog("Choose the Input PDF File", "*.pdf", false);
var pdfOption = new PDFOpenOptions();
pdfOption.cropPage = CropToType.TRIMBOX;
pdfOption.antiAlias = true;
pdfOption.constrainProportions = true;
pdfOption.resolution = 400;
pdfOption.mode = OpenDocumentMode.RGB;
pdfOption.bitsPerChannel = BitsPerChannelType.EIGHT;
pdfOption.suppressWarnings = true;
app.open(inputFiles, pdfOption, false);

 

This topic is closed to new replies. Start a new post to keep the conversation going.

30 replies

c.pfaffenbichler
Community Expert
Community Expert
May 9, 2022 3:40 PM UTC

Please porvide a pdf for which the problem happens. 

Translate
Prabu IAuthor
Known Participant
May 10, 2022 7:39 AM UTC

Hi @c.pfaffenbichler  i have attached the sample pdf document and also attached manual output and script produced output screen shot.

Manual output:

 

Script produced output:

  

Translate
c.pfaffenbichler
Community Expert
Community Expert
May 10, 2022 8:31 AM UTC

I suspect you hit limits when trying to convert a pdf at 400ppi that’s more than 4m broad. 

Translate