Bookmarks with the same name are lost

Hello,

I am trying to add bookmarks with the same name in different sections of my report, but only the first bookmark with the repeated name is being added to the pdf document. Is there a solution for this? 


Thanks!


3 Replies

JT Jeyalakshmi Thangamarippandian Syncfusion Team February 9, 2024 03:48 PM UTC

We have created a sample for adding bookmarks with the same name in different sections. The sample is attached for your reference. We kindly request you to try it out and let us know if you require any further assistance.

 

Sample:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/Framework_184668-996110467.zip




NW Natalie Westphal February 9, 2024 04:32 PM UTC

I am trying to add the bookmarks to a Word Document. 

Using this code: 

section.Paragraphs[0].AppendBookmarkStart("Bookmark1 Title");

section.Paragraphs[section.Paragraphs.Count - 1].AppendBookmarkEnd("Bookmark1 Title");


but when the title is the same, they are not being added or shown in the PDF if I convert the WordDoc



AA Akash Arul Syncfusion Team February 12, 2024 11:15 AM UTC

Natalie, bookmarks with a name can be set only for one content. The bookmark with the same name can’t be added twice. Kindly check the below screenshot to know the bookmark in Microsoft Word.

In the above screenshot, when we tried to add the bookmark with the same name, the Add button is disabled. So we can’t do this in Microsoft Word. This is the default behaviour of bookmarks in Microsoft Word. And DocIO does the same. As the conclusion the bookmarks with same name cannot be set for multiple contents in the Word document.


Loader.
Up arrow icon