Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Hi @jethika27020132be9l ,
what is the exact version of InDesign, InDesign Server and the versions of the corresponding operating systems?
Do you see the issue with all book documents?
Thanks,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi @Laubender
InDesign Server (IDS): v19.3
InDesign Desktop: v19.5.4
No, we don’t see this with all book documents.
The issue occurs only in specific cases particularly when:
The image frame is auto-sized (typically height-only or both width and height)
The image frame includes an inline anchored object
Copy link to clipboard
Copied
Hi @jethika27020132be9l ,
thank you very much for the additional information.
Hm. That is hard to test without having a document at hand.
Well, could you prepare a test document with only one image where you see the problem and make it available here? ( Attach the InDesign document and perhaps the image to your answer. )
Thanks,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi sorry for the late reply
Unfortunately, we’re using a custom plugin that handles image rendering, so the images won’t appear correctly unless that plugin is installed which makes it hard to share a reproducible test file.
What I’m really looking for is more of a theoretical explanation:
Is there some kind of internal recalculation, layout refresh, or hidden recomposition that happens automatically when exporting a book to PDF via the InDesign UI, but not when scripting the export?
Because in our case, if we explicitly call recompose() on each .indd file in the book before exporting, the missing images show up as expected in the final PDF. This suggests the UI might be triggering something internally that we need to replicate via script.
Would love any insights on whether that's expected behavior or something specific to book automation.
Copy link to clipboard
Copied
Unfortunately, we’re using a custom plugin that handles image rendering, so the images won’t appear correctly unless that plugin is installed
By @jethika27020132be9l
That's a welcome detail. As @Laubender has already mentioned, the plug-in could be the reason for your issue. You may want to contact the plug-in developer for clarifications.
Copy link to clipboard
Copied
Also, try the same script in InDesign 2025 - does the same problem happen there?
Copy link to clipboard
Copied
yes
Copy link to clipboard
Copied
@jethika27020132be9l said: "… Because in our case, if we explicitly call recompose() on each .indd file in the book before exporting, the missing images show up as expected in the final PDF. This suggests the UI might be triggering something internally that we need to replicate via script. Would love any insights on whether that's expected behavior or something specific to book automation."
Hm. The question is if your workflow with your custom plugin that handles image rendering requires a recompose() before the export to PDF. I would test a sample that does not require the custom plugin first to see if the plugin is a factor.
Regards,
Uwe Laubender
( Adobe Community Expert )
Find more inspiration, events, and resources on the new Adobe Community
Explore Now