Hi there,
I have a little challenge in my current project.
I am reading Word document which is saved in SQL Server and trying to convert it into Html string. Because the current solution is already using WebSuperGoo.ABCpdf and I have to append this new word document as Html string to the ABCpdf document. How can I convert the this word stream into Html string (not into Html stream)
BTW, if I save this stream into html file on disk, it works. But as I said, I need to have this stream as string
Here is the sample code:
Note: “narratives” is a DataRow
If narratives.Length > 0 And Not IsDBNull(narratives(0)("word_description")) Then
Dim inputBytes() As Byte
inputBytes = CType(narratives(0)("word_description"), Byte())
Dim stream As Stream = New MemoryStream(inputBytes)
Dim streamHtml As Stream = New MemoryStream()
Dim doc As Aspose.Words.Document = New Aspose.Words.Document(stream)
Dim htmlOptions As HtmlSaveOptions = New HtmlSaveOptions(SaveFormat.Html)
htmlOptions.ImageSavingCallback = New HandleImageSaving()
doc.Save(streamHtml, htmlOptions)
'This is the place where I need to append this new Html String with AbcPdf document
theID = abcPdfDoc.AddImageHtml(streamHtml.ToString())
End If
Appreciate your help