Hi,
#1, convert html to word directly. This way has proved, there had some format issues, such as, “multi-row text not break line in table, when convert it to pdf”, etc. It’s hard to fix the format issues, so, I change to try #2 now.
#2, search the marked html contents in word, and insert bookmark into word. But, this way also have potential problems. How can find object exactly in word? How to avoid find same contents from other non-selected area? So, I want to get your suggestion about: 1) How to get all objects id?As I know, when aspose convert word to html, the node id of objects in word will miss after converting. Is there any way to keep these ids in html? If get all ids, then I can find marked contents more exactly in the range of selected object id.
Thanks in advance
Vance
Hi Vance,
Thanks for your inquiry.
First
of all, please note that Aspose.Words is quite different from the
Microsoft Word’s Object Model in that it represents the document as a tree of objects
more like an XML DOM tree. If you worked with any XML DOM library you
will find it is easy to understand and work with Aspose.Words. When you
load a Word document into Aspose.Words, it builds its DOM and all
document elements and formatting are simply loaded into memory. Please
read the following articles for more information on DOM:
There is no object/Node ID in Aspose.Words DOM. However, you can get CompositeNode with an index by CompositeNode.GetChild Method. This method returns an Nth child node that matches the specified type.
Secondly,
It would be great if you please share following details for our
reference. We will then provide you more information about your query
along with code.
- Please supply us with the input document
- Please supply us with the html document
- Please supply us with the expected document showing the desired behavior (You can create this document using Microsoft Word).