Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. rtf output

rtf output

Scheduled Pinned Locked Moved The Lounge
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Richard Stringer
    wrote on last edited by
    #1

    Anyone know where I can get a working example of code to take plain text and output rtf format. I know, I'm lazy, but Ijust thought I'd ask before reinventing the wheel. :-O If you pick up a starving dog and make him prosperous, he will not bite you. This is the principal difference between a dog and a man. - Pudd'nhead Wilson's Calendar

    J L 2 Replies Last reply
    0
    • R Richard Stringer

      Anyone know where I can get a working example of code to take plain text and output rtf format. I know, I'm lazy, but Ijust thought I'd ask before reinventing the wheel. :-O If you pick up a starving dog and make him prosperous, he will not bite you. This is the principal difference between a dog and a man. - Pudd'nhead Wilson's Calendar

      J Offline
      J Offline
      John Fisher
      wrote on last edited by
      #2

      Hi, this has worked really well for me. If you need more than just text->RTF, I can give you some links. :)

      static CString RtfCode(_T("{\\rtf{"));
      static CString par(_T("\\par "));

      CString tempText = YourTextHere;

      // Convert the necessary characters.
      tempText.Replace(_T("\\"), _T("\\\\"));
      tempText.Replace(_T("}"), _T("\\}"));
      tempText.Replace(_T("{"), _T("\\{"));
      tempText.Replace(_T("\r\n"), par);
      tempText.Replace(_T("\n\r"), par);
      tempText.Replace(_T("\r"), par);
      tempText.Replace(_T("\n"), par);

      // Make it into an rtf string.
      tempText.Insert(0, RtfCode);
      tempText += _T("}}");

      John

      1 Reply Last reply
      0
      • R Richard Stringer

        Anyone know where I can get a working example of code to take plain text and output rtf format. I know, I'm lazy, but Ijust thought I'd ask before reinventing the wheel. :-O If you pick up a starving dog and make him prosperous, he will not bite you. This is the principal difference between a dog and a man. - Pudd'nhead Wilson's Calendar

        L Offline
        L Offline
        loket
        wrote on last edited by
        #3

        Put it in an edit ctrl and stream it out as rtf maybe?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups