Hello.
I import a HTMLBody to a RadDocument. It's coming from Outlook.MailItem, so I also have attachments.
Dim provider As HtmlFormatProvider = New HtmlFormatProvider()
Dim doc = provider.Import(currentMail.HTMLBody)
The HTMLBody contains something like this:
<img src="cid:ii_kuchydn60" alt="logo.jpg" width="145" height="89">
So the displayed image element is just a rectangle with a red x.
Is there a way to also import an image / Outlook.Attachment to the document (other than saving the attachment and then modifying src property of img tag)?
Edit: based on Tanya's answer I was able to do this, it works but I'm not sure how safe it is:
Private Sub LoadImageFromUrl(sender As Object, e As LoadImageEventArgs)
Dim att = (From a As Attachment In currentAttachments Where a.FileName = e.ImageElement.Alt).FirstOrDefault
If att IsNot Nothing Then
Dim tempFile = IO.Path.GetTempPath + att.FileName
att.SaveAsFile(tempFile)
e.ImageElement.UriSource = New Uri(tempFile)
e.Handled = True
End If
End Sub
Jure