简体   繁体   中英

How to read contents of RTF and assigned to Richtextbox?

I need to read more than 1 file rtf files and assigned to Richtextbox 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM