Pictures from URL
Posted: Fri Nov 30, 2018 9:03 am
I import HTML text of email from database using TRVHTMLViewImporter and THtmlViewer.
When the letter contains pictures with src = "http://some site" TRVHTMLViewImporter adds a prefix - path of executable file.
The code is:
rvMail is TRichViewEdit where text will imported to.
I tried to switch this properties
RVHTMLViewImporter->AutoHyperlinks = false;
RVHTMLViewImporter->ImgSrcToImageName = true;
but is no effect.
In event handlers
HTMLViewer->OnImageRequest = HtmlViewer1ImageRequest;
HTMLViewer->OnImageRequested = HtmlViewer1ImageRequested;
HTMLViewer->OnFilenameExpanded = HtmlViewer1FilenameExpanded;
all URLs are correct.
Where and who adds a prefix "c:\work...\" to them I have no idea.
What should I do?
When the letter contains pictures with src = "http://some site" TRVHTMLViewImporter adds a prefix - path of executable file.
The code is:
Code: Select all
RVHTMLViewImporter = new TRVHTMLViewImporter(Owner);
RVHTMLViewImporter->HTMLViewer = HTMLViewer;
RVHTMLViewImporter->AutoHyperlinks = false;
RVHTMLViewImporter->ImgSrcToImageName = true;
TMemoryStream *stream = new TMemoryStream();
((TBlobField*)qPost->FieldByName("htmltext"))->SaveToStream(stream);
stream->Seek(0,0);
HTMLViewer->LoadFromStream(stream, path,HTMLType);
RVHTMLViewImporter->ImportHtmlViewer(HTMLViewer, rvMail, path); // Here is error: Cannot open file "c:\work\...Win32\Debug\http:\www.some site\image.jpg"
I tried to switch this properties
RVHTMLViewImporter->AutoHyperlinks = false;
RVHTMLViewImporter->ImgSrcToImageName = true;
but is no effect.
In event handlers
HTMLViewer->OnImageRequest = HtmlViewer1ImageRequest;
HTMLViewer->OnImageRequested = HtmlViewer1ImageRequested;
HTMLViewer->OnFilenameExpanded = HtmlViewer1FilenameExpanded;
all URLs are correct.
Where and who adds a prefix "c:\work...\" to them I have no idea.
What should I do?