Skip to main content
Participant
May 27, 2025
Question

PDF Export from Book Script Ignores Auto Sized Image Frames Unless recompose() Is Called

  • May 27, 2025
  • 2 replies
  • 525 views

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?

 

 

2 replies

Community Expert
May 29, 2025

@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 )

Community Expert
May 27, 2025

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 )

Participant
May 27, 2025

Hi @Laubender 

 

  • InDesign Server (IDS): v19.3

  • InDesign Desktop: v19.5.4

  • OS: Windows 11 Enterprise (version 24H2)

 

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

 

 

Community Expert
May 27, 2025

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 )