Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 542087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:24:37+00:00 2026-05-13T10:24:37+00:00

How can I convert an RTF file to a PDF one? I have the

  • 0

How can I convert an RTF file to a PDF one? I have the adobe PDF printer, should I use it? If so, how can I programmatically access it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:24:37+00:00Added an answer on May 13, 2026 at 10:24 am

    Actually, none of these are terribly reliable or do what I want. The solution is simple, install Adobe Acrobat and just have it open the RTF file using the Process class.

    I also found a more reasonable approach. I save the file as an RTF, the open it in word, and save it as PDF (Word’s Print As PDF plugin must be installed)

                SaveFileDialog sfd = new SaveFileDialog();
                sfd.Filter = "Personal Document File (*.pdf)|*.pdf";
                if (sfd.ShowDialog() == DialogResult.OK) {
                    String filename = Path.GetTempFileName() + ".rtf";
                    using (StreamWriter sw = new StreamWriter(filename)) {
                        sw.Write(previous);
                    }
    
    
                    Object oMissing = System.Reflection.Missing.Value;    //null for VB
                    Object oTrue = true;
                    Object oFalse = false;
    
                    Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
                    Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
    
                    oWord.Visible = false;
                    Object rtfFile = filename;
                    Object saveLoc = sfd.FileName;
                    Object wdFormatPDF = 17;    //WdSaveFormat Enumeration
                    oWordDoc = oWord.Documents.Add(ref rtfFile, ref oMissing, ref oMissing, ref oMissing);
                    oWordDoc.SaveAs(ref saveLoc, ref wdFormatPDF, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                         ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    
                    oWordDoc.Close(ref oFalse, ref oMissing, ref oMissing);
                    oWord.Quit(ref oFalse, ref oMissing, ref oMissing);
    
                    //Get the MD5 hash and save it with it
                    FileStream file = new FileStream(sfd.FileName, FileMode.Open);
                    MD5 md5 = new MD5CryptoServiceProvider();
                    byte[] retVal = md5.ComputeHash(file);
                    file.Close();
    
                    using (StreamWriter sw = new StreamWriter(sfd.FileName + ".md5")) {
                        sw.WriteLine(sfd.FileName + " - " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToShortTimeString() + " md5: " + BinaryToHexConverter.To64CharChunks(retVal)[0]);
                    }
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I programmatically convert RTF documents to PDF ?
When I have access to UrlHelper I can convert an ActionResult to a string
We have a project where we need to convert the following file types to
I have an RTF file that I need to display to a user. I
I have crystal report and I need to convert it to text file. Currently
How can convert a certain file into in a String? And then from that
I know I can convert a single file encoding under OSX using: iconv -f
You can convert a negative number to positive like this: int myInt = System.Math.Abs(-5);
we can convert character to an integer equivalent to the ASCII value of the
How i can convert to c# code files to html files?Is there any generation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.