We are trying out Aspose words for our requirement over here and we could not exactly get the solution for us using Aspose words. Let us know if we are following the correct path or are we missing anything here.
We have a requirement of converting an edited docx file into pdf. The docx file has bookmarks which we were able to fill in with data using Aspose. However we have a typical scenario where in we have header which is different for the first page. So we have set up a header (with image) which is different on the first page and the subsequent pages have a different header. We also have bookmarks for fitting in variou data elements. We also have this requirement of inserting html data into this word document. We used AppendDocument for inserting the html but since we have 2 different bookmarks it is always appending to the second page and keeping the first page empty. Also some formatting are also lost (even basic formatting like underlines). We also tried using mail merge which does not work for some reasons and also the inserthtml method which does not keep the formatting at all. I have attached the html that we are trying to put it in word, the word document itself and also some code parts. Let us know if we can achieve our requirements with Aspose.
Thanks for the reply. We tried using the InsertDocument function and it worked perfectly fine for our scenario. However we are not able to get all the formatting information in the html to the word or pdf document. Is there a way we can persist all the formatting information across the word and pdf documents. I also tried to put the html into a word document using OpenXml and then insert the word document but met with little success.
To summarize I want to insert the content of any of the attached files into the word and then convert it to pdf with the formatting (like underlines and bold) persisted.
The problem occurs because currently Aspose.Words does not support inheriting styles from parent objects in HTML. Please see the following document to learn more about restrictions during HTML import/export: