Skip to main content
Known Participant
May 9, 2022
Question

PDF import in photoshop

  • May 9, 2022
  • 1 reply
  • 5871 views

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 has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
May 9, 2022

Please porvide a pdf for which the problem happens. 

Prabu IAuthor
Known Participant
May 10, 2022

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:

  

Stephen Marsh
Community Expert
Community Expert
May 10, 2022

Hi,

Thanks for the replies. Is there any possible way in script to give the same output as manual for this kind of Large size PDF?


If I receive the javascript code for that then its much useful for me.

 

Please advise.

 

Thanks


As I wrote, for me, in Photoshop 2021 (22.5.7), the manual open and the script open both results in exactly the same image, there is no difference/distrotion. I can't reproduce your issue with your test file.