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

  • 10 Rules that Make or Break Enterprise App Development Projects In today's app-driven world, application development is a top priority. Even so, 68% of enterprise application delivery projects fail. Designing and building applications that pay for themselves and adapt to future needs is incredibly difficult. Executing one successful project is lucky, but making it a repeatable process and strategic advantage? That's where the money is. With help from our most experienced project leads and software engineers, …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds