Skip to main content
September 24, 2009
Question

Image conversion (tiff -> jpeg)

  • September 24, 2009
  • 1 reply
  • 468 views

Hello,

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:

graphic.exportFile(ExportFormat.JPG,graphicOutputFileJPG, false);

Then, I exchange the old images with the new ones:

var link = graphic.itemLink
link.relink(graphicOutputFileJPG);

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!!

This topic has been closed for replies.

1 reply

September 24, 2009

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.

Best regards,

- Peder