3 Replies Latest reply on Jul 3, 2012 4:43 AM by Muppet Mark

    [Javascript] How to trim/crop an image for export


      Hey folks,


      Got lucky with an answer the first time, thought I'd try again.  In Illustrator CS5+, I'm looping through the objects in a document, exporting each of them to an image using exportArtBoardasImage().  They need to be trimmed afterwards, as they generally have a tonne of whitespace.  Normally, I run an ImageMagick shell script (mogrify -trim).  It'd be awesome if I could reproduce this functionality from within illustrator.  I've seen people handle this by copy-and-pasting each object into a new file, sizing the artboard to that object, exporting, then closing the file.  I'd rather not do this, as it's *way* too slow.  Any other suggestions?