Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i am having a text file which contains 10-15 lines which need to get formatted and then print file conatins

Company Name
Address line1
Address line2
Address line3
-----------------------
Product Qty Rate Amount
|
|
|
|
------------------------------
Total : 2000

I need company name in bigger font(font size 20, font name times new roman, font style bold tec) address line in small font(font size 10 font name times new roman)
Product qty line in (font name arial, font size 10)

after formatting in need to print this.
Posted
Comments
Nikhil Bhivgade 6-Jan-15 2:26am    
trying to work with string.format but no success till now.

1 solution

When you posted this question yesterday, you were told that strings don't have any format, and neither do text files, and it was explained to you exactly how to print using a PrintDocument and what to do to use different fonts and font sizes.

Nothing has changed since then: If you are printing, use a PrintDocument, if you are using "print" as a word for "output to a text file" you can't do it, if you mean "to a file that can do it" that is a different problem, and if you mean "to the display" it depends on the environment and controls you are using.

I explained all this yesterday - so what has changed?
 
Share this answer
 
Comments
OriginalGriff 6-Jan-15 3:08am    
Yes - it's not completyely trivial, but there are a lot of articles which can help you do it:
https://www.google.co.uk/search?q=write+to+rtf+file+c%23&oq=write+to+richtext+file&aqs=chrome.1.69i57j0l5.5754j0j7&sourceid=chrome&es_sm=93&ie=UTF-8#safe=off&q=write+to+rtf+file+c%23+site:codeproject.com

Or

https://www.google.co.uk/search?q=write+to+rtf+file+c%23&oq=write+to+richtext+file&aqs=chrome.1.69i57j0l5.5754j0j7&sourceid=chrome&es_sm=93&ie=UTF-8#safe=off&q=write+to+word+file+c%23+site:codeproject.com
OriginalGriff 6-Jan-15 3:26am    
You're welcome!

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