I need to convert all linked images in the document to jpeg. I have found a solution to iterate over the graphics collection and export each one of them using the exportFile method:
Then, I exchange the old images with the new ones:
var link = graphic.itemLink
Basicly, this works fine. But the images have white borders. I believe this is because they only use a section of the original image, the clipped parts are then left white. However, I would like to either crop those white spaces or take the full size of the original image!
I have looked at the PDFExportPreset Object that be specified in the exportFile method, but I was unable to indentify the setting that will do the trick!
Thanks for any hint!!
Maybe you could use the BridgeTalk api to get Photoshop to do the conversion.
I have never tried it myself, but I'm sure you can find sample code that gets you 80% there if you search for this.