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

  • Live Event Date: September 19, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT In response to the rising number of data breaches and the regulatory and legal impact that can occur as a result of these incidents, leading analysts at Forrester Research have developed five important design principles that will help security professionals reduce their attack surface and mitigate vulnerabilities. Check out this upcoming eSeminar and join Chris Sherman of Forrester Research to learn how to deal with the influx of new device …

  • Specialization and efficiency are always in need. Whether it's replacing an aging roof, getting a haircut, or tuning up a car, most seek the assistance of trusted experts. The same is true in the business world, where an increasing number of companies are seeking the help of others to administer their IT systems and services. This special edition of Unleashing IT highlights a new breed of IT caretaker -- Cisco Powered service providers -- and the business advantages and operational efficiencies they …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds