如何读取RTF的内容并分配给Richtextbox?

发布于 2024-10-04 08:57:21 字数 73 浏览 0 评论 0原文

我需要读取 1 个以上的 rtf 文件并分配给 Richtextbox,这反过来又有助于将其转换为 pdf?

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如何视而不见 2024-10-11 08:57:21

RichTextBox 类包含一个函数LoadFile(string path)。将您要加载的文件的位置传递给 LoadPath 函数,它将显示它。

如果修改文本,可以通过调用 RichTextBoxes SaveFile 函数将其另存为 RTF 文件。请参阅下面的参考资料以获取更多信息。

如果要将文档保存为 PDF,您需要在安装 PDF 打印驱动程序后将文件打印为 PDF,或者需要使用第三方 API 创建可导出为 PDF 的文档。

参考: http://msdn.microsoft.com/en -us/library/system.windows.forms.richtextbox.aspx

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文