1 Reply Latest reply on Jul 27, 2014 2:30 AM by Jump_Over

    Output first page of doc as 20mm high jpg

    happytown2

      Hi there,

       

      I need to output the first page of several thousand documents as 20mm high jpegs (at 300dpi).

       

      Chinnadk kindly helped me get this far:

       

      var doc = app.activeDocument;    
          w = doc.documentPreferences.pageWidth;  
      doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.pixels;  
      doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.pixels;  
        
      app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;   
      app.jpegExportPreferences.exportResolution = 300/w*72;   
      app.jpegExportPreferences.pageString = doc.pages[0].name;    
      doc.exportFile(ExportFormat.JPG, new File(doc.fullName.toString().replace(/\.indd$/i,".jpg")), false); 
      

       

      but that was before I realised I needed it 20mm high.

       

      Any help much appreciated.

        • 1. Re: Output first page of doc as 20mm high jpg
          Jump_Over Level 5

          Hi,

           

          1. It depend on your first page structure but you could group every pageItems - resize them - select result - and export with 300 dpi set.

               However it can be pretty complex to resize various kinds of objects.

           

          2. You could use BridgeTalk to call Adobe Photoshop and resize given JPG to desired output.

               However it need some studies about BridgeTalk,

               i.e. here http://wwwimages.adobe.com/content/dam/Adobe/en/products/indesign/pdfs/JavaScriptToolsGuid e_CS5.pdf

               (see chapter 5)

               but... if Photoshop is available for you - easier than scripting is to use predefined action for such simple job...

           

          3. Assuming you have set of JPGs already (but wrong size) and no Photoshop in touch -

               you could place them one by one to a new InDesign doc (with output size) -

               fit content to frame -

               and export selection again.

           

               The last way looks like almost discovered and easy to proccess.

           

          Jarek