I am looking for a way to programatically export embedded images from InDesign documents. These images are not linked files are a placed image would normally be. Instead, they seem to be completely embedded within the InDesign file; exporting as IDML causes the image data to be exported within XML itself.
Searching in the scripting reference leads to the Image.exportForWeb and Image.exportFile methods. However, when I tried the exportForWeb function, it failed silently and returned null.
The exportFile method worked but it takes as input the export format. Since the format of the original image is not available within the script, using exportFile will entail a potentially lossy conversion. (Checking for the imageTypeName for the Image object throws a "The property is not applicable in the current state" error.) Also, the exported file generated with exportFile seems to be limited to 20kb regardless of how large the original image is.
Is there a better way to go about exported these images? Any ideas why exportForWeb won't work. Thank you.