Click here to Skip to main content
14,361,043 members
Rate this:
Please Sign up or sign in to vote.
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.
Nikhil Bhivgade 6-Jan-15 2:26am
trying to work with string.format but no success till now.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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?
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:

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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100