Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 22972 |  Welcome, Guest!   Register  Login
 Home > Blogs > C# > Easiest Method to Save RTF File as PDF Document with C#, VB.NET ...
Lacy

Easiest Method to Save RTF File as PDF Document with C#, VB.NET

 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 document


C# 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:


About Keating Arly

Experience:1 year(s)
Home page:http://www.e-iceblue.com
Member since:Tuesday, March 27, 2012
Level:Starter
Status: [Member]
Biography:
>> Write Response - Respond to this post and get points

More Blogs

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 12:37:45 PM