HTML String to Stream to PDF


I am trying to read a string of html out of a database, convert that to a, and then pass that stream to the bindHTML method. How can I do this? I tried using the following code with no luck. Any suggestions?

Dim ms as string = “…”

Dim s As System.IO.Stream

Dim b() As Byte

Dim utf As New System.Text.UTF7Encoding

b = utf.GetBytes(ms)

s.Write(b, 0, b.Length)



…one more question. Can you pass a MemoryStream to BindHTML?


MemoryStream is supported. I test with the following code and it works:

Dim p As Pdf = New Pdf()

Dim s As String = “Hello world”
Dim b() As Byte = System.Text.Encoding.UTF8.GetBytes(s)
Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream(b)