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 3406144
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:35:31+00:00 2026-05-18T05:35:31+00:00

My current application send an .rtf in an attachement. I wish to send pdf

  • 0

My current application send an .rtf in an attachement. I wish to send pdf instead of that.
Where in my code I should modify the same?

Below is my code

        RichTextBox rtbReport = new RichTextBox();   //Creating instance of Richtextbox
        AppResult objResult = null;                  //Object of Class
        frmExaminationReport objReport = new frmExaminationReport(examinationID,   ProviderID, PatientID, examType);                        // Object of Class
        AddressBookDataTable dtAddress = null;
        rtbReport.Rtf = objReport.RTF;               // Entire Result is assigned to Richtext box class
         frmMail objMail = new frmMail();            //Object of Mail Class
         string directoryPath = Application.StartupPath + "\\Temp"; //Creating directory

         string tempFileName = "Report_" + DateTime.Today.Year.ToString() +  DateTime.Today.Month.ToString() + ".rtf";      //Generating Name
            FileStream fsReport = new FileStream(directoryPath + "\\" + tempFileName, FileMode.CreateNew);                            // FileStream
            fsReport.Write(ASCIIEncoding.ASCII.GetBytes(rtbReport.Rtf), 0, rtbReport.Rtf.Length);                         // Writing
            fsReport.Flush();
            fsReport.Close();
            fsReport.Dispose();
            objMail.MailSubject = examType + " Report";   //Mail Subject

Let me know if any inputs needed

  • 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-18T05:35:32+00:00Added an answer on May 18, 2026 at 5:35 am

    Your code is incomplete or does not make sense (only for me?). Here is a simple tutorial to send email with attachment.

    If you are generating PDF documents using your code then checkout some related questions in SO.

    I don’t think you can simply change .rtf to .pdf to generate PDF documents.

    string tempFileName = examType + "Report_" + DateTime.Today.Year.ToString() +  DateTime.Today.Month.ToString() + ".rtf"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client application that should send notify messages to an optional server
I would like to send an email from an application that contains the current
Want to send the text from my current vb application to the Active Window
I want to implement in my application the option to send the current user
The current application that I'm working on seems to recycle the application pool very
I'm trying to get the current application name (the application that contains the current
How can I make my application send SMS using C#? My current configuration sends
For a current project, we're designing a client desktop application that parses text files
I have a LabVIEW application that current sends data to a C++ application via
I am developing a phonegap application that sends the current GPS location to a

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.