I have RTF formated text in some Database fields. Sometime I need the unformatted Text for export to a plain Text file. In this routine I have no DBRichView(Edit) field on hand.
What is the easiest way to extract the plain Text from the RTF formated field?
How to retrive plain Text form an RTF DB Field?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
See http://www.trichview.com/forums/viewtopic.php?t=2702
It uses ReadFromFile method, but you can use ReadFromStream to read RTF from DB.
It uses ReadFromFile method, but you can use ReadFromStream to read RTF from DB.
-
- Posts: 130
- Joined: Fri Mar 04, 2011 3:44 am
Hello,
I'm trying to get this working for an unicode text and use OnNewUnicodeText of the parser as suggested in the linked article, but the event seems not to get fired since DoReaderText isn't being executed.
If I use the OnNewText event, it is being fired, but the result is wrong for a unicode text.
Does it have to be a RTF-Code stored with the DBRichView? At the moment it's being saved with a RzDBRichViewEdit / a cxDBRichEdit and looks like this:
It's strange to see "...\ansi\..." in the code, but it's always the same and the RichEdits seem to be fine with that...
Any idea why OnNewUnicodeText doesn't get fired?
I'm trying to get this working for an unicode text and use OnNewUnicodeText of the parser as suggested in the linked article, but the event seems not to get fired since DoReaderText isn't being executed.
If I use the OnNewText event, it is being fired, but the result is wrong for a unicode text.
Does it have to be a RTF-Code stored with the DBRichView? At the moment it's being saved with a RzDBRichViewEdit / a cxDBRichEdit and looks like this:
Code: Select all
{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset204 Calibri;}{\f1\fnil\fcharset0 Calibri;}}
{\colortbl ;\red0\green0\blue0;}
\viewkind4\uc1\pard\cf1\f0\fs24\'ef\'f0\'ee\'e3\'f0\'e0\'ec\'ec\'e8\'f0\'ee\'e2\'e0\'ed\'e8\'e5\f1\par
}
Any idea why OnNewUnicodeText doesn't get fired?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 130
- Joined: Fri Mar 04, 2011 3:44 am
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry, the correct link is http://www.trichview.com/support/files/textfromrtfw.zip