Helo Awais,
thanks for your fast reply and suggestion.
But I'm afraid your suggestion did not work for me. I changed the library from version 10.0.0.0 to 10.5.0.0 as suggested and the result was about the same.
The generated html for version 10.0.0.0 is:
Evaluation Only. Created with Aspose.Words. Copyright 2003-2010 Aspose Pty Ltd.
https://xxxSecretLinkInDocumentxxx.pdf"><span style="font-family: arial; color: #0000ff; font-size: 10pt; text-decoration: underline">Organisation: Test Test Test
The generated html for version 10.5.0.0 is:
The code I use is just simple:
public string GetHtmlFromWord(Stream stream)
{
// Load the entire document into memory.
Document doc = null;
try
{
doc = new Document(stream);
}
catch (UnsupportedFileFormatException uffe)
{
throw new UnsupportedFileFormatSDLException();
}
// You can close the stream now, it is no longer needed because the document is in memory.
stream.Close();
// Create a new memory stream.
MemoryStream outStream = new MemoryStream();
// Set an option to export form fields as plain text, not as HTML input elements.
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
// Save the document to stream.
doc.Save(outStream, options);
// Convert the document to byte form and in text-string
byte[] docBytes = outStream.ToArray();
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
string html = enc.GetString(docBytes);
return html;
}
Do you have any more suggestions?
Thanks and Greetings
Rolf