Page 1 of 1
Getting started with TRichView
Posted: Tue Apr 16, 2013 10:47 am
by PetterT
Hi, I would appreciate your help to get started using TRichView.
In my database I have several blobs that contain HTML formatted text.
I need to convert the HTML in each blob to Native TRichView Format in order to use TRichView as primary editor and preview control.
Or perhaps there are other better ways to do this...?
Suggestions on steps to perform and possibly demos that shows this?
Best regards
Petter Topp
Posted: Tue Apr 16, 2013 12:50 pm
by Sergey Tkachenko
Unfortunately, TDBRichViewEdit does not understand HTML. It can work with RVF (native format), RTF or a plain text.
However, you can use OnLoadCustomFormat to load HTML from DB to editor, and OnSaveCustomFormat to save HTML to DB.
For HTML loading, you need either rvHtmlImporter or rvHTMLViewImporter (better) components. The both are free, can be found in
http://www.trichview.com/resources/
Sample code is:
http://www.trichview.com/forums/viewtopic.php?t=3197
Posted: Wed Apr 17, 2013 5:36 am
by PetterT
Hi Sergey.
Just to be sure:
1. TRichView can't be used to convert HTML to RVF format?
2. And if using the rvHTMLImporter, I can only save the content of the editor back to HTML?
3. If I use the rvHtmlImporter to get the HTML content, can this content be edited using the RichView editor (wysiwyg)?
4. Do you have any other suggestion on how to convert the html content to rvf?
Petter
Posted: Wed Apr 17, 2013 6:01 am
by Sergey Tkachenko
1. It can be used, but together with additional (free with source code) components. If HTML is simple, TrvHtmlImporter is enough. If this HTML uses CSS, you need to use TrvHtmlViewImporter (+ free THTMLViewer).
2. For saving to HTML, additional components are not required, TRichView has SaveHTMLEx method.
3. Yes. But it's important to understand, that the original HTML structure will not be kept. After loading and saving HTML, HTML code will be completely different (while visually the document should be the same, if it does not contain HTML features unsupported by TRichView)
4. rvHtmlViewImporter is currently the best solution.
Posted: Wed Apr 17, 2013 6:39 am
by PetterT
I think the preferable way would be to convert HTML to RVF.
Given your answer in point 1. - I can import HTML using rvHtmlImporter, and save to database in RVF format?
And my HTML is simple no css is involved.
Petter
Automate conversion from HTML to RVF
Posted: Thu Apr 18, 2013 10:10 am
by PetterT
I have tested the rvHTMLImport component, and it works just fine.
Now I'm about to make a utility that converts the html content in my database into RVF format as an automated one-time process.
How should I approach this without actually displaying the html content in RichView?
Br
Petter