How to read contents of RTF and assigned to Richtextbox?
I need to read more than 1 file rtf files and assigned to Richt开发者_JS百科extbox which in turn would be helpful in converting the same to pdf?
thanks!
The RichTextBox class contains a function LoadFile(string path). Pass the LoadPath function your the location of the file you want to load and it will display it.
If you modify the text, you can save it back out as an RTF file, by calling the RichTextBoxes SaveFile function. See the reference below for further information.
If you want to save a document to PDF you need to either print the file to a PDF after installing a PDF printing driver or you will need to use a third party API for creating documents that you can export to PDF.
Ref: http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx
精彩评论