0

I've found plenty of scripts where I can define resolution, but is possible to export the first page of an indesign document with a specified height (in this case 20mm at 300dpi). I have several thousand documents to do and need a script!

Thanks

1 Answers1

1

It is possible, but you might have to do it outside of InDesign by calling an external script (applescript or vb). Here's an example exporting the first page of the active document as a jpeg with javascript. You can use app.doScript() to call the applescript or vb after exporting.

var doc = app.activeDocument;

app.jpegExportPreferences.properties = {
   exportResolution: 300, // dpi
   exportingSpread: false,
   jpegExportRange: ExportRangeOrAllPages.exportRange,
   jpegQuality: JPEGOptionsQuality.maximum,
   pageString: "1"
};

var exportPath = File("~/Desktop/TestExport.jpg");

doc.exportFile(ExportFormat.jpg, exportPath, false);

// Do additional image transformation here using external program
Josh Voigts
  • 4,114
  • 1
  • 18
  • 43
  • Would this work? (1) create a new document at the required size (20mm x ???) (2) place first page of the original (3) scale down (4) export at 300 dpi? – Jongware Jul 29 '14 at 23:50
  • I'm not sure if it would work or not by making the InDesign document (20mm) (might be tough to scale things correctly), but it _would_ work if you called another program after exporting the file like [image magick](http://www.imagemagick.org/) or even photoshop to resize the jpg... – Josh Voigts Jul 30 '14 at 13:41