Closed trichter2 closed 1 year ago
Hi Tom, could you please post or email an example file/text?
If the image is not a link to a local file system or an embedded base64 image, you can use THtmlViewer.OnImageRequest to provide a TStream with the image. For downloading from the internet you may use Indy or ICS controls. See FrameBrowzerDemoIcs resp FrameBrowzerDemoId10 for details.
Hi Bernd, attached you can find a zip file containing an ics file. This file can be imported into Outlook and should be an appointment with the text displayed above.
Tom, in your application you must implement THtmlViewer.OnImageRequest(Sender: TObject; const SRC: string; var Stream: TStream);
In your example it will be called with SRC = 'cid:image002.jpg@01D8CE82.78A095D0' and Stream = nil.
Your implementation must provide Stream for sources with scheme 'cid:'.
In 'Test Calendaritem-zip' is no image. It should be part of the surrounding MIME tree. Something like
Content-Type: image/jpeg;
Content-ID: <image002.jpg@01D8CE82.78A095D0>
Content-Transfer-Encoding: ...
If OnImageRequest exits with Stream still = nil, THtmlViewer tries to load that source from a the local file system, which will fail.
Without external support THtmlViewer can load files from a local file system, base64 encoded inline images and images from resources (scheme 'res:').
Most probably encoding of your image2.jpg will be base64. See function GetTheBase64(Name: ThString) in HTMLSubs.pas how to convert base64 to a stream.
Hello, again Bernd, first of all, thank you for your help. Everything works fine now. Nevertheless, I have gotten some issues importing the HTMLViewer to the HTMLViewImporter. To solve this I have implemented the OnImportPicture event from the richedit. In this event, I load the graphic for the image manually.
Hello, again HTMLViewer-Team, I try to extract the body of an outlook appointment into a richedit. Using redemption I get the HTML body of the appointment. To import the body into the richedit I use the following lines of code: The text, fonts, and links are displayed perfectly but the images are not. It seems like they can not be loaded. They are displayed with a big red X. Is there anything I can do to display the images? If I open the HTML file everything is fine:
Best regards Tom