My use case is an advanced document analysis task, where I need to analyze the content of a word document. I am new to syncfusion, and have just started integrating it. Currently I am converting the docx to html, assigning paragraph level indices to each html paragraph (for document traversal), and then preparing a report where I display a side by side view. The left hand side displays my prepared analysis, and the right hand side displays the html version of the document. A key feature is the ability to click on links in the left hand side, and have the document scroll to the location that is being referred to (hence document traversal).
Does syncfusion, or SFDT format support anything like paragraph level indexing that would allow me to:
a) read the document content, as plain, unstyled text, ideally html on the front end where the analysis takes place
b) insert markers into the document that would allow me traverse it as I have described
Any suggestions would be very much appreciated.
Hi Jamie Steiner,
For your requirement, we suggest adding a bookmark to each paragraph and then exporting the document as HTML.
During HTML export, Syncfusion converts bookmarks into anchor tags like:
| <a id="para_1"></a> |
This allows you to traverse to specific paragraphs in the document using standard HTML navigation.
Kindly let us know if this approach meets your requirements.
Regards,
Mohammed Affan C
It might work - is there a code example you can share for adding the bookmarks? I'd need for the library to help me do this, as in my use case, the documents will come to me without any such bookmarks.
Hi Jamie Steiner,
We are currently preparing a sample for your requirements. We will provide an update by 20 June, 2025.
Regards,
Mohammed Affan C
Hi Jamie Steiner,
We have created a sample for your reference. In this example, we utilized the Syncfusion DocIO library to read a DOCX file and insert a bookmark for each paragraph. Subsequently, the file was converted into SFDT format and sent to the client side along with the bookmark data.
On the client side, we implemented a list and a document editor. Upon clicking a button, the document is opened, bookmarks are added, and the data is sent back to the client side. The list is then updated, and the processed document is opened. Clicking a bookmark name in the left pane selects the corresponding paragraph in the document editor.
Please review the sample and let us know if it fulfills your requirements.
Client Sample - https://stackblitz.com/edit/react-5xoyjbyb?file=index.js
Kindly ensure the server-side sample is executed before running the client-side sample.
Regards,
Mohammed Affan C