TCustomRichView.OnImportFile

<< Click to display table of contents >>

TCustomRichView.OnImportFile

Occurs when loading a file or a stream containing links to other files.

type
  TRVImportFileEvent = procedure(
    Sender: TCustomRichView;
    const Location: TRVUnicodeString;
    out Content: TStream) of object;
 
property OnImportFile: TRVImportFileEvent;

(introduced in version 21)

This event may occur when loading HTML that has external style sheets.

If these links are local (like 'c:\images\styles.css'), TRichView can load these files itself. But if files are on the Internet (like 'https://www.trichview.com/styles.css'), it makes sense to process this event and to download the image.

Input parameters

Location path to the file (local or URL);

Output parameters

Content a stream that contains the file content. If you leave it equal to nil, TRichView will attempt to load the file itself.

 

If you use RichViewActions, they can use downloader components to download files automatically, when loading is initiated by the action (Open, Insert File, Paste and Paste Special actions). This downloader can also be used in OLE drag&drop, see OnBeforeOleDrop and OnAfterOleDrop events.