Images in TOC will not be shown

Hi,

it seems that update of TOC does not support images in header lines.
After manual update of TOC in Microsoft Word images will be shown in TOC.
See attachement ‘Toc And Images.docx’ that is created per Aspose.

Thanks a lot
Best regards
Matthias

Hi Matthias,

Thanks for your inquiry. Perhaps, you’re using an older version of Aspose.Words; as with Aspose.Words v11.9.0, I was unable to reproduce this problem on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v11.9.0 and let us know how it goes on your side. I hope, this will help.

Hi Tahir,

thanks for your answer. I am using latest release 11.9.0 of Aspose Words .
At the end of the creation process i call the following update methods.

document.updateFields();
document.updateListLabels();
document.updatePageLayout();
document.updateTableLayout();
document.updateWordCount();
document.updateThumbnail();

Perhaps there is another method for updating TOC field?

Thanks a lot
Matthias

Hi Matthias,

Thanks for sharing the information. Please use latest version of Aspose.Words for Java. Please note that every new release of Aspose.Words comes up with some new features, enhancements in the existing features and bug fixes.

The Document.updateFields() method updates the TOC (Table of contents). I suggest you to read following documentation articles for your kind reference.
https://docs.aspose.com/words/java/update-field/

Hi Tahir,

here is my code for reproducing the problem. What is to do?

  1. Create a test folder on your filesystem
  2. Copy image ok.png into your test folder
  3. Update static member PATH (enter your test older path) in TestTOCAndImages.java
  4. Start TestTOCAndImages.java
Result:
  • TestTocAndImages.doc will be created in your test folder
  • TOC does not contain images that are part of each header line (that is the problem)
  • After manual update of TOC in Word, images in TOC will be shown
Best regards
Matthias

Hi Matthias,

Thanks for the additional information. I have worked with your shared document/code and have not found any issue with TOC. I have also updated the TOC manually by using MS Word and have not seen any difference in output document. Please see the attached image.

It seems that you want to create custom images for a bullets. If yes, please read following forum link for your kind reference.
https://forum.aspose.com/t/89524

Hope this answers your query. If you still face problem related with images/TOC, please create a sample word document by using MS Word (Images in TOC) and share it with us. We will share the code with you accordingly.

Hi Tahir,

i don’t want to create custom images instead of bullets. I just want to insert an image to a text line that uses a header stye. That works fine!
My problem is, that this image is not shown in TOC, although i tried to update fields per Aspose.
To avoid any misunderstanding see attachements.
By the way, the following pictures are based on the generated word document file ‘TestTocAndImages.doc’ of your last mail.

  1. TestTocAndImages Before Manual Update.png

    You see your generated word document file (created by Aspose)

    TOC does not contain the green checkmark!

  2. TestTocAndImages Perform Manual Update.png

    I perform the manual update for the TOC per F9 - entire TOC

  3. TestTocAndImages After Manual Update.png

    Now TOC does contain the green checkmark! <

    Best regards
    Matthias

Hi Matthias,

Thanks for sharing the details. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-7297 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-7297) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.