extract an rtf field of firebird database
-
Hello, I'm doing a program in C # and i need to extract an rtf field of firebird database .Na fact the field is a string, but I think the field is a document rtf that was encoded and inserted through language delfi. Under a piece of the field: {\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset0 Arial Unicode MS;}{\f3\fnil\fcharset0 Tahoma;}{\f4\fnil\fcharset1 Cambria Math;}{\f5\fnil\fcharset238 Times New Roman CE;}{\f6\fnil\fcharset204 Times New Roman Cyr;}{\f7\fnil\fcharset161 Times New Roman Greek;}{\f8\fnil\fcharset162 Times New Roman Tur;}{\f9\fnil\fcharset177 Times New Roman (Hebrew);}{\f10\fnil\fcharset178 Times New Roman (Arabic);}{\f11\fnil\fcharset186 Times New Roman Baltic;}{\f12\fnil\fcharset163 Times New Roman (Vietnamese);}{\f13\fnil\fcharset238 Arial CE;}{\f14\fnil\fcharset204 Arial Cyr;}{\f15\fnil\fcharset161 Arial Greek;}{\f16\fnil\fcharset162 Arial Tur;}{\f17\fnil\fcharset177 Arial (Hebrew);}{\f18\fnil\fcharset178 Arial (Arabic);}{\f19\fnil\fcharset186 Arial Baltic;}{\f20\fnil\fcharset163 Arial (Vietnamese);}{\f21\fnil\fcharset0 Lucida Sans Unicode;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw11906\paperh16838\margl0\margr0\margt10\margb0\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}} {\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}} {\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}} {\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}} {\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} \endnhere\sectdefaultcl{\header \pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \par }{\*\wptable\tblleft2000 Tab1}{\pard\trowd\trgaph0\trleft2000\cellx5302\cellx8604\cellx11906\intbl{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \cell} \intbl{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0
-
Hello, I'm doing a program in C # and i need to extract an rtf field of firebird database .Na fact the field is a string, but I think the field is a document rtf that was encoded and inserted through language delfi. Under a piece of the field: {\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset0 Arial Unicode MS;}{\f3\fnil\fcharset0 Tahoma;}{\f4\fnil\fcharset1 Cambria Math;}{\f5\fnil\fcharset238 Times New Roman CE;}{\f6\fnil\fcharset204 Times New Roman Cyr;}{\f7\fnil\fcharset161 Times New Roman Greek;}{\f8\fnil\fcharset162 Times New Roman Tur;}{\f9\fnil\fcharset177 Times New Roman (Hebrew);}{\f10\fnil\fcharset178 Times New Roman (Arabic);}{\f11\fnil\fcharset186 Times New Roman Baltic;}{\f12\fnil\fcharset163 Times New Roman (Vietnamese);}{\f13\fnil\fcharset238 Arial CE;}{\f14\fnil\fcharset204 Arial Cyr;}{\f15\fnil\fcharset161 Arial Greek;}{\f16\fnil\fcharset162 Arial Tur;}{\f17\fnil\fcharset177 Arial (Hebrew);}{\f18\fnil\fcharset178 Arial (Arabic);}{\f19\fnil\fcharset186 Arial Baltic;}{\f20\fnil\fcharset163 Arial (Vietnamese);}{\f21\fnil\fcharset0 Lucida Sans Unicode;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw11906\paperh16838\margl0\margr0\margt10\margb0\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}} {\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}} {\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}} {\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}} {\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} {\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}} \endnhere\sectdefaultcl{\header \pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \par }{\*\wptable\tblleft2000 Tab1}{\pard\trowd\trgaph0\trleft2000\cellx5302\cellx8604\cellx11906\intbl{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \cell} \intbl{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0
It looks, feels and smells like a string containing RTF codes; why wouldn't you just get it like any other string field and either assign it to a RichTextBox.Rtf, or write it to a file (preferably with extension .rtf)? :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!