1 person found this helpful
Perhaps issue a document wide recompose, immediately after your "place" command?
Maybe a sledge hammer solution, but I think it's meant specially for cases like this. If it works, you can try if it works when you limit it to your newly placed Story -- that also has a recompose() method.
Excellent! It works great. I tried insertionpoint.recompose(), but it was obviously not enough.
I had the same problem trying to export to PDF. It sometimes did not export all the new pages and changes. recompose() before export helped!
It will enforce the text to re flow subsequent pages. How it will help you to export to PDF
The problem I had was that the script generated page content, and then exported to PDF, but the export sometimes happened before all the pages were created, so in effect there were pages missing. But adding recompose() before export made the pages appear.
For your scenario it's okay. But some cases recompose wont help you to retain the finished layout.