RTF print

  • Thread starter Thread starter Dmitri Shvetsov
  • Start date Start date
D

Dmitri Shvetsov

Hi All,

Who prints RTF files or streams from C#? Can you give a hint or a good
advice? How to do it easier?

Regards,
Dmitri Shvetsov
 
Hi,

I can't believe that nobody prints here from RTF files. I found an example
from VS2003, it can load RTF file or a plain text, we can see the formatted
text in a window, then if we preview or use a printer preview we see a plain
text, but not the original RTF document with formats, fonts, centered
strings etc. Cool! Why did Microsoft published this !@# example if it
doesn't work? They included a simple RTF file in their project and it can be
loaded, but when I try to load my own file, little bit complicated with
included URLs the preview rises the exception. What's going on? Is it a
common problem?

I could call WinWord from my application lo load and print this document but
I assume that the client knows nothing about WinWord and even doesn't have
the Office installed. So, what's the official way to print the formatted RTF
document from C#?

Any suggestions, hints, advices are welcome!

Dmitri Shvetsov
 
Dmitri Shvetsov said:
Hi,

I can't believe that nobody prints here from RTF files. I found an example
from VS2003, it can load RTF file or a plain text, we can see the formatted
text in a window, then if we preview or use a printer preview we see a plain
text, but not the original RTF document with formats, fonts, centered
strings etc. Cool! Why did Microsoft published this !@# example if it
doesn't work? They included a simple RTF file in their project and it can be
loaded, but when I try to load my own file, little bit complicated with
included URLs the preview rises the exception. What's going on? Is it a
common problem?

I could call WinWord from my application lo load and print this document but
I assume that the client knows nothing about WinWord and even doesn't have
the Office installed. So, what's the official way to print the formatted RTF
document from C#?
There is no offical way, however one can make the RichTextBox class print.
Hopefully this will do what you need:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_richtextbox.asp
(watch for line wrap)
 
Back
Top