How to receive INLINE_GRAPHIC_STATUS_CHANGE only once on text flow changes
Hello,
I have a scenario in which I need to replace some images in a text flow with substitutes and then later I need to "restore" the text flow and show the original images. I update the text flow by adding/removing FlowElements. After the point when I "restore" the text flow I receive INLINE_GRAPHIC_STATUS_CHANGE events for all the images that were restored. This is rather a problem for me because when I "restore" I would like immediately to calculate the new dimensions of the text flow (or rather its containers).
Is there a way to achieve such "restore" so I get the proper dimensions (iamge sizes) immediately?
I do not want to receive the notifications asynchronously later because my effects depend on the exact image sizes.
As mentioned I tried with adding/removing FlowElements. I also tried working with TextScrap i.e. cut a TextScrap before adding the substitutes and then paste the same TextScrap when "restoring". This didn't help neither. It again reloads the images from scratch and doesn't reuse the initially loaded image data.
One workaround could be to create two sets of containers with two text flows where the only difference is the images put in the text however this may lead to too big memory consumption and/or performance problems and I would like to avoid it if possible.
Any ideas are very appreciated!
