Blog author:
Lacy | Posted on: 5/27/2012 | Category:
C# Blogs | Views: 1799 | Status:
[Member] |
Points: 75
|
Alert Moderator
Conversion between different files always enjoys great popularity among people. It is also a hot and permanent topic people talked about. Especially for PDF document conversion, as a most popular file format, PDF has so many advantages. So "Convert to PDF" is most concerned by people. Now I want to show how to save RTF file as PDF document with C#, VB.NET.
The method is the easiest way to save RTF file as PDF if you use Spire.Doc,which is an MS Word creation component and supports .NET and Silverlight. Please look at the whole procedure.
Step1. Create a new project.1. Create a new project in Visual Studio.
2. Set the project Properties .Target Framework to be .NET Framework 2 or above.
3. Add Spire.Doc dll and System.Drawing as reference in Project.Step2. Save RTF file as PDF document.1. Create a new document.
2. Load a RTF file from system.
3. Save the RTF file as PDF documentC# Code:
Document doc = new Document();
doc.LoadFromFile(@"D:\michelle\JaneEyre.rtf", FileFormat.Rtf);
doc.SaveToFile("test.pdf", FileFormat.PDF);
System.Diagnostics.Process.Start("test.pdf");
VB.NET Code: Dim doc As New Document()
doc.LoadFromFile("D:\michelle\JaneEyre.rtf", FileFormat.Rtf)
doc.SaveToFile("test.pdf", FileFormat.PDF)
System.Diagnostics.Process.Start("test.pdf")
Preview
Isn't it the easiest way to convert RTF to PDF? Why not take this method to try?
Found interesting? Add this to: