Skip to main content
happytown2
Participant
July 27, 2014
Question

Output first page of doc as 20mm high jpg

  • July 27, 2014
  • 1 reply
  • 121 views

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.

This topic has been closed for replies.

1 reply

Jump_Over
Legend
July 27, 2014

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/JavaScriptToolsGuide_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