How should I use CS5 scripting to convert the current InDesign page to an image and place it, tagged on that same page.
I have downloaded to reference and if provided pointers to a couple of the methods to use I could suss it out myself thereafter.
Edit
- Place back into the current page (if your pages are numbered normally)
- Export to the current user’s application directory
var doc = app.activeDocument; app.jpegExportPreferences.properties = { antiAlias: true, embedColorProfile: true, exportResolution: 150, // exportingSpread: true, // Uncomment if spreads jpegColorSpace: JpegColorSpaceEnum.rgb, jpegExportRange: ExportRangeOrAllPages.exportRange, jpegQuality: JPEGOptionsQuality.maximum, jpegRenderingStyle: JPEGOptionsFormat.baselineEncoding, useDocumentBleeds: false, simulateOverprint: false, pageString: app.activeWindow.activePage.name // Page(s) to export, must be a string } var userFolder = Folder ( Folder.userData.absoluteURI + "/Brilliant" ); if (!userFolder.exists) userFolder.create(); var tempFile = File(userFolder+"/page.jpg"); doc.exportFile(ExportFormat.jpg, tempFile); var pageNumber = parseInt(app.activeWindow.activePage.name)-1?parseInt(app.activeWindow.activePage.name)-1:0; var pageToPlace = doc.pages[pageNumber].place(tempFile); tempFile.remove();
Here’s a sample that might do what you are looking for. There’s no easy way to save a jpg directly in an InDesign document, but you can export it to a temporary file and then place it back in. You might have to tune things a little bit to get things right but something like this should do the trick.