Click here to Skip to main content
15,610,761 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all i have created small application, from my application i am writing my output in a notepad file, when i write my output i will declare font too..

but my font is not assigning to the notepad file ,
below is my code
using (StreamWriter writer = new StreamWriter(Server.MapPath("~/Temp_Report/" + Session["User"] + ".Barcode.txt"), true))
              Font font1 = new System.Drawing.Font("IDAutomationSC128M DEMO", 11);//// Font name(font Declaration)
              writer.WriteLine("THAMEEM HOME CENTET,L.L.C");
              writer.WriteLine("Same Value", font1);
              writer.WriteLine("Short Description");

give me solution for my issue..
Updated 4-Sep-11 22:36pm

Text files do not include formatting. The user can select a font and size in the application but it is not stored in the text file.

If you need file type including formatting, consider using pdf, doc, html etc.
Share this answer
sameertm 5-Sep-11 4:41am    
so this same code(which i wrote) will work for doc file ?
Take a look at the following codeproject article.

NRTFTree - A class library for RTF processing in C#[^]

Think this is exactly what you need.
Share this answer
sameertm 5-Sep-11 5:32am    
i guess there is no relation between my question and your answer(article)!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900