Bookmarks are bring converted into anchor tags

Hi Aspose team,
Hope you are doing fine!

I have a work document which contains Bookmarks (I have attached this document). When I am converting it to HTML, then it is generating anchor tags (below is the HTML conversion of attached document).

<a name="test2">This is a bookmark</a><a name="test"></a>

Is it possible that bookmarks are converted into div/p tags instead of anchor (a) tags? Thanks!

Regards,
Zeeshan

Hi Zeeshan,

Thanks for your inquiry. It would be great if you please share your expected output HTML. We will then provide you more information about your query along with code.

Hi,
Thanks for quick response!

I am expecting the output as shown below. Thanks!

<p style="margin-top:0pt; margin-bottom:8pt; line-height:108%; font-size:11pt"><span style="font-family:Calibri">This </span><span style="font-family:Calibri">is</span><span style="font-family:Calibri"> a bookmark</span></p>

Regards,
Zeeshan

Hi Zeeshan,

Thanks for sharing the detail. Please use following code example to get the desired output.

Document doc = new Document(MyDir + "Bookmark_test.docx");
doc.Range.Bookmarks["test"].Remove();
doc.Range.Bookmarks["test2"].Remove();
doc.Save(MyDir + "17.5.html");