Hello,
We are evaluating Aspose.Word to complete a function for our business. We are using Aspose to take data from MS Word and save it into our application as HTML. After the notes are loaded into our application we will use a Rich Text Editor to update the note. Finally we will take the note and use Aspose to export those updated notes into word again to start the process over.
The problem is the HTML that Aspose defaults out contains inline styles:
<span style=\"font-family:Verdana; font-size:9pt; font-style:italic; font-weight:bold; text-decoration:underline\"> Test Text </span>
This represents text that was Bold, Underlined and Italics. Our rich text editor cannot read the inline styles, and must have it in the format (effectively not using inline styles):
<span><b><i><u> Test Text </u></i></b></span>
Is there anyway that Aspose can do this out of the box, or how would i begin to convert the HTML to use HTML tags rather than inline styles?
This is how I’m getting the HTML from the word document (we are using bookmarks to tag regions to differentiate different notes):
Document dstDoc = new Document();
CompositeNode dstNode = dstDoc.LastSection.Body;
NodeImporter importer = new NodeImporter(srcDoc, dstDoc, ImportFormatMode.KeepSourceFormatting);
AppendBookmarkedText(importer, srcBookmark, dstNode);
//Open word document.
//Save html to stream.
MemoryStream htmlStream = new MemoryStream();
dstDoc.Save(htmlStream, SaveFormat.Html);
//Read all text from stream.
string htmlText = Encoding.UTF8.GetString(htmlStream.GetBuffer());
htmlStream.Close();
return htmlText;
Thanks, please let me know if there are any other questions.
Pete