RTF file research tips

  1. Convert Chinese to Ansii string

        7 int main(int argc, char* argv[])

        8 {

        9     printf("Hello World!/n");

       10 

       11     char chTest[]="电";

       12     int n1 = (unsigned char)(chTest[0]) << 8;

       13     int n2 = (unsigned char)chTest[1];

       14 

       15     int   i   =   n1+n2;  

       16     char   a[3];  

       17     a[0]   =   (char)((i   &   0xff00)   >>   8);  

       18     a[1]   =   (char)(i   &   0xff);  

       19     a[2]   =   0;  

       20     printf("%s/n",a);

       21 

       22     return 0;

       23 }

  2. Some Links:
    rtflib from www.codeproject.com
    rtfx   you can google it.
    latex2rtf from www.sourceforge.net
    gc1039.exe from www.msdn.com.  It will give you some info about how to read rtf file directly using c++.
    http://msdn.microsoft.com/en-us/library/aa140301.aspx
    abiword http://www.abisource.com/   There are a RTF importer/Exporter plugin source code.But I do not familiar with it.
    I think in Windows Platform,you can use RichEdit control to do the below actions:
    Merge 2+ rtf files to one rtf file just use copy and paste,of course you should use TOM or just create 2 hidden richEdt box to switch the data.That is easy.Also you can find the plain text from RTF use EM_GETTEXTEX and stream out a butter then go to find the string what you want catch.

  3. RTF have the advantage and disadvantage.I recommended you to use HTML,XML etc.But RTF is good supported by MS.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值