Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Bridge talk for InDesign CS4/CS5 js

$
0
0

Hi,

 

Have this code that opens file in Ph and resaves it in different format. In this case I need to adjust it to open pdf file in photoshop and set crop to media box. It works with pdf files as is, but if there is white space around artwork, it gets removed. How can I set it to open with media box:

 

 

function ResaveInPS(myImagePath, myNewPath) {     try {           var myPsDoc = app.open(new File(myImagePath));             if (myPsDoc.mode == DocumentMode.CMYK) {                    myPsDoc.changeMode(ChangeMode.RGB);               }           var docName = myPsDoc.name;          var myPNGSaveOptions = new PNGSaveOptions();          myPNGSaveOptions.interlaced = false; // or true          myPsDoc.saveAs(new File(myNewPath), myPNGSaveOptions, true);          myPsDoc.close(SaveOptions.DONOTSAVECHANGES);          }     catch (err) {          try {               app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);          }          catch (err) {}     }
}

 

 

Thank you for your help.

Yulia


Viewing all articles
Browse latest Browse all 15932

Latest Images

Trending Articles



Latest Images