Hello RichView Suport,
we have tested your components [CompiledDemos\ActionTests\ScaleRichView\ActionTestUni.exe] from this link https://www.trichview.com/rvfiles/TRich ... sSetup.exe. There occured one problem in inserting a html text from a mail. The font in the mail was ARIAL. After inserting the text into the RichEdit via function „Paste Special…“ in HMTL format the font of the text in the RichEdit was „TimesNewRoman“.
Are you aware of this effect and is it possible to keep the font of the original HMTL text in the RichView?
Best Regards
Nedeljka
Font is not taken when inserting into RichEdits in HTML format
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Font is not taken when inserting into RichEdits in HTML format
Hello,
The compiled demo uses a basic HTML importer (TrvHtmlImporter component) that supports only basic HTML formatting; it does not support CSS.
There is an alternative HTML importer component producing much better results, TrvHtmlViewImporter.
But it requires additional third-party component, THMLViewer.
It is free with source code. You can download it here: https://github.com/BerndGabriel/HtmlViewer
After installing its packages (for new versions of Delphi, they are named FrameViewer.dpk (runtime) and dclFrameViewer.dpk (designtime)), recompile TRichView packages (use "Install TRichView in Delphi IDE" shortcut in Windows Start menu).
TrvHtmlViewImporter must be installed.
To use it in RichViewActions, open one of ActionTest projects. Place THTMLViewer on a main form, make it hidden. Place TrvHtmlViewImporter on the same form. Assign RVAControlPanel1.HTMLComponent = rvHtmlViewImporter1, rvHtmlViewImporter.HTMLViewer = HTMLViewer1.
That's all. Now open, insert file, and paste actions use this importer.
The compiled demo uses a basic HTML importer (TrvHtmlImporter component) that supports only basic HTML formatting; it does not support CSS.
There is an alternative HTML importer component producing much better results, TrvHtmlViewImporter.
But it requires additional third-party component, THMLViewer.
It is free with source code. You can download it here: https://github.com/BerndGabriel/HtmlViewer
After installing its packages (for new versions of Delphi, they are named FrameViewer.dpk (runtime) and dclFrameViewer.dpk (designtime)), recompile TRichView packages (use "Install TRichView in Delphi IDE" shortcut in Windows Start menu).
TrvHtmlViewImporter must be installed.
To use it in RichViewActions, open one of ActionTest projects. Place THTMLViewer on a main form, make it hidden. Place TrvHtmlViewImporter on the same form. Assign RVAControlPanel1.HTMLComponent = rvHtmlViewImporter1, rvHtmlViewImporter.HTMLViewer = HTMLViewer1.
That's all. Now open, insert file, and paste actions use this importer.
Re: Font is not taken when inserting into RichEdits in HTML format
Greetings Sergey,
Would you still recommend this HTMLViewer with Delphi 11? We are pasting from HTML into TRichViewEdit but are not getting color. Is this perhaps why? (Even using Paste Special > Html)
Would you still recommend this HTMLViewer with Delphi 11? We are pasting from HTML into TRichViewEdit but are not getting color. Is this perhaps why? (Even using Paste Special > Html)
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Font is not taken when inserting into RichEdits in HTML format
Yes, HTML import using THTMLViewer + TrvHtmlViewImporter is still the best option.
Re: Font is not taken when inserting into RichEdits in HTML format
Any possibility of a "TrvHCLImporter" that integrates with http://delphihtmlcomponents.com/?
I assume it can produce better import result.
I assume it can produce better import result.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Font is not taken when inserting into RichEdits in HTML format
No, I plan to implement native HTML import, without third-party components.
Currently, this is the main priority (not counting FMX-related features)
Currently, this is the main priority (not counting FMX-related features)
Re: Font is not taken when inserting into RichEdits in HTML format
Will the html importer work with external css? Also will it be a tag style < > importer?
We are using the older version and need to update to accommodate the external css. (We have done a lot of internal modifications to the previous html importer to support some of our needs.)
I added regex support before the import so we can modify portions of the html as we need and so we can add our own specialized tags.
We are using the older version and need to update to accommodate the external css. (We have done a lot of internal modifications to the previous html importer to support some of our needs.)
I added regex support before the import so we can modify portions of the html as we need and so we can add our own specialized tags.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Font is not taken when inserting into RichEdits in HTML format
Yes, native HTML import code will support all types of CSS, internal, external and inline.
It is almost ready but still too buggy to be released.
I'll complete port to Android (soon) and return to HTML import.
It is almost ready but still too buggy to be released.
I'll complete port to Android (soon) and return to HTML import.