rtf output
-
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
-
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
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
-
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