开发者

trying to extract formatted images from indesign into a separate folder

开发者 https://www.devze.com 2023-02-26 01:06 出处:网络
I\'m looking for a way to extract images from an ID file in a \'formatted\' / cropped form. i.e: a. I have placed numerous, hi-res (tiff, psd) images into an InDesign CS5 file

I'm looking for a way to extract images from an ID file in a 'formatted' / cropped form.

i.e: a. I have placed numerous, hi-res (tiff, psd) images into an InDesign CS5 file b. The image boxes that they have been placed into, are smaller than the actual image (pretty intense cropping occurred) c. I am trying to collect these images in their new stage (cropped to the image box) and export them as jpg at 72dpi.

Are there any plug-ins out there that would automatica开发者_如何转开发lly collect "formatted" images from ID for me? Or is there some other way?


If you're familiar with Indesign Scripting, this can very easily be done via a script. I use Javascript but this can be done with VBSript or AppleScript as well. Here is a basic example of a script that will open a document, and export a rectangle (your image box) as a JPG. Basically, you can just loop through the pictures in your document and export each one to a location/filename you choose (see the myFile variable below). There are several "jpegExportPreferences" you can pick from to determine how your output JPG will be (i.e. DPI).

test();
function test(){

    var myDoc = app.open('c:/user/desktop/testDocument.indd');
    var myGroups = myDoc.groups;

    //for each group...
    for (var i = 0;i < myGroups.length; i++){
        // for each rectangle in the group...
        for(var r = 0; r< myGroups[i].rectangles.length; r++){

             var myRect = myGroups[i].rectangles[r];
               app.jpegExportPreferences.exportResolution = 300;
               app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.MAXIMUM;

               //give it a unique name
               var myFile = new File('c:/users/desktop/newJPG' + myRect.id + '.jpg');

               myRect.exportFile(ExportFormat.JPG, myFile);

               }
           }

  }

For a list of the other optional JPG Export preferences, see this link: http://indesignscriptingreference.com/cs2/javascript-cs2/jpegexportpreference.htm

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消