I'm trying to import to RV data with images from html, but can't do this. Text importing is ok, but fail with images.
May be demo will be helpful but the package "RvHtmlViewImporter v1.15.2"
has no demo
Missing Demo in RvHtmlViewImporter v1.15.2
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
The code for loading from file is very simple:
The last parameter defines the base path for images and links. Probably, pictures were not loaded because it was not specified.
Note that the importer can automatically import only local images. If they are in the Internet (http-links), you need to import them yourself. You can do it in TRichView.OnImportPicture event.
If you use the importer in RichViewActions, and also activate support for Indy or CleverComponents, they can download images from http automatically.
Code: Select all
if OpenDialog1.Execute then begin
HTMLViewer1.LoadFromFile(OpenDialog1.FileName);
RVHTMLViewImporter1.ImportHtmlViewer(HTMLViewer1, RichViewEdit1,
ExtractFilePath(OpenDialog1.FileName));
NormalizeRichView(RichViewEdit1.RVData);
RichViewEdit1.Format;
end;
Note that the importer can automatically import only local images. If they are in the Internet (http-links), you need to import them yourself. You can do it in TRichView.OnImportPicture event.
If you use the importer in RichViewActions, and also activate support for Indy or CleverComponents, they can download images from http automatically.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, but not in very near future.
However, you can decode it yourself in OnImportPicture event.
Currently, we have an example only for encoding base64 when saving HTML: http://www.trichview.com/forums/viewtopic.php?t=7191
But decoding is similar.
Write a decoded image in a stream, then load it to a graphic class using RVGraphicHandler.LoadFromStream method (RVGraphicHandler is a global variable defined in RVGrHandler unit) . This method autodetects graphic format by content. This method was added in TRichView v16.4.
If you use a trial of 16.0, you will be able to update it tomorrow, we are uploading the update.
However, you can decode it yourself in OnImportPicture event.
Currently, we have an example only for encoding base64 when saving HTML: http://www.trichview.com/forums/viewtopic.php?t=7191
But decoding is similar.
Write a decoded image in a stream, then load it to a graphic class using RVGraphicHandler.LoadFromStream method (RVGraphicHandler is a global variable defined in RVGrHandler unit) . This method autodetects graphic format by content. This method was added in TRichView v16.4.
If you use a trial of 16.0, you will be able to update it tomorrow, we are uploading the update.