Let me give more background on what I’m testing.
I have a small RTF document stored in a database (it’s raw text is stored in a varchar column in a table).
Using your component, I’m converting the RTF to HTML, so I can display it in an HTML editor control:
Dim sMemo As String = docrec.GetTextMemoValue()
Dim RTF As Byte() = System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes(docrec.GetTextMemoValue())
Dim memoryStream As System.IO.MemoryStream = New System.IO.MemoryStream(RTF)
Dim doc As New Document(memoryStream)
' Create and pass the object which implements the handler methods.
Dim options As New HtmlSaveOptions(SaveFormat.Html)
options.ExportTextInputFormFieldAsText = True
options.ImagesFolder = "C:\inetpub\wwwroot\Adept8.3\tmp\ADM"
options.ImagesFolderAlias = "/[Adept8.3/tmp/ADM/](http://localhost/Adept8.3/tmp/ADM/)"
Dim dstStream As New MemoryStream()
doc.Save(dstStream, options)
Dim pos = dstStream.Position
dstStream.Position = 0
Dim reader As New StreamReader(dstStream)
Dim str = reader.ReadToEnd()
oEditor.Html = str
oEditor.ID = "MemoField"
The user can edit the text in the HTML editor and when they click “Save” I need to convert the HTML back to RTF:
Dim HTML As Byte() = System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes(oEditor.Html)
Dim memoryStream As System.IO.MemoryStream = New System.IO.MemoryStream(HTML)
Dim doc As New Document(memoryStream)
Dim options As New RtfSaveOptions()
Dim dstStream As New MemoryStream()
doc.Save(dstStream, options)
doc.Save("c:\temp\rtf\saved-from-ae.rtf", options)
The problem is that the images are saved to disk by your component:
options.ImagesFolder = "C:\inetpub\wwwroot\Adept8.3\tmp\ADM"
options.ImagesFolderAlias = "/Adept8.3/tmp/ADM/"
If I change the path of the imageFolderAlias to:
options.ImagesFolderAlias = "http://localhost/Adept8.3/tmp/ADM/"
I’m could get burned down the road, because I cannot guarantee that the image path is http://localhost/
. It could be a fully-qualified domain name or it could be https.
Is there a way to specify the directory where images are located?