PDF Export from Book Script Ignores Auto Sized Image Frames Unless recompose() Is Called
Hi everyone,
We're running into a consistent issue when exporting a book (.indb) to PDF via script, particularly in InDesign Server workflows.
When exporting a book using a script like this:
book.exportFile(ExportFormat.PDF_TYPE, pdfFile, false, preset);Some images inside auto-sized image frames (usually with height or height+width auto-sizing enabled) do not appear in the final PDF.
However, if we add the following logic:
var doc = app.open(bookContent.fullName, false);
doc.recompose(); //This seems to fix it
doc.close(SaveOptions.YES);then re export the book, all images appear correctly.
what we observed
The frames are visible in InDesign UI, and images appear fine.
If I export a chapter directly with indesign UI, PDF is fine.
If I export the .indb book without recompose(), images are missing.
This happens in both InDesign Desktop and InDesign Server, but especially affects automated flows.
So my questions are
Why does book.exportFile() fail to render images in auto-sized frames unless recompose() is called beforehand?
Is this expected behavior when exporting books via script or from InDesign Server?
Are there other layout-related updates that don’t happen unless documents are opened and recomposed?
