Strip RTF tags

These four files will help you to convert the RTF contents of a CString to the plain text.

You have to do the following

Include the two header files and two .cpp files in your project and just call the function
convertRTF (CString csInput, CString & csout);
by passing the fist CString with the RTF content and get the output form the second parameter.

Due to the time constraint , I couldn't write the functions as fully object oriented. If some one feels that can be changed to the object orientated style it is welcome.

Download source - convertrtf.zip ??KB

Date Posted: 08/11/98


Comments

  • Anyone know how to compile this code?

    Posted by Legacy on 07/29/2002 12:00am

    Originally posted by: Mike Pliam

    I really need to strip (rtf tags - that is), but cant figure out how to use this code. I've tried adding the four files to a CRichEditView sdi app, but it wont compile.

    Desparately seeking an answer. Thanks.

    Reply
  • MSDN Documentation

    Posted by Legacy on 09/27/2001 12:00am

    Originally posted by: John

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec_46.asp

    Copyright 1801

    Reply
  • Bug in the funcion ecRtfParse(FILE * fp )

    Posted by Legacy on 11/11/1998 12:00am

    Originally posted by: Gernot Schachner

    Thank you for the verry useful function to convert RTF-strings into Text-strings, but there is a  bug in it!
    
    

    The calculation of the decimal number from the hexadecimal number in the function ecRtfParse(FILE * fp ) is wrong!You must add 10 if the character is 'a' to 'f' or 'A' to 'F', see the code below!

    if (islower(ch))
    {
    if (ch < 'a' || ch > 'f')
    return ecInvalidHex;
    // old code !! b += (char) ch - 'a';
    b += (char) ch - 'a' + 10;
    }
    else
    {
    if (ch < 'A' || ch > 'F')
    return ecInvalidHex;
    // old code !! b += (char) ch - 'A';
    b += (char) ch - 'A' + 10;
    }

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Is your sales and operations planning helping or hurting your bottom line? Here are 5 useful tips from the experts at Quintiq to guide you to a better S&OP strategy.

  • Live Event Date: August 13, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT If you are developing applications, you'll want to join us to learn how applications are changing as a result of gesture recognition. This technology will change how you and your users interact - not simply with your devices, but with the world around you. Your devices will be able to see and hear what your users are doing. Are your applications ready for this? Join us to learn about Intel® RealSense™ Technology, including never been …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds