Best aproach for letter program

EFileTahi-A

Contributor
Joined
Aug 8, 2004
Messages
623
Location
Portugal / Barreiro
I need to create a small program to print letters. The user simply needs to fill some fields (textboxes) and then the letter's body through a RichTextBox.

Now, since Text-Justify, Bold and Italic are required for these letters, I need to find a way of printing the letters with such formatting.

How can I accomplish this? How can I then print the text of a RichTextBox while maintaining its graphical structure (bold, italic and justify)?

Thank you.
 
Well, 29 views and no answers, which makes me believe I was not explicit enough.

I will reformulate my needs:
How can I print a formated input of a RichTextBox (you know, with bold, italic, underline etc.)? I mean, is this even possible without resorting to math involving measuring string lengths for horizontal positioning and line counting for vertical positioning, based code tags for their respective font styles?
 
Last edited:
If you are lookin at printing everything yourself then you are pretty much stuck with managing the layout entirely - all the sizing, measuring and positioning become your problem.

Depending on your needs you might find it easieer to generate a word document from the user input and print that, you could also consider generating a pdf or if you are running .Net 3 or higher then creating an XPS document might be a valid option.

If WPF is a possibility then it's richtextbox will take care of pretty much creating a xps document for you.
 
Thanks for the reply!

How difficult is to generate a word doc from the user input through .NET controls? Does .NET (I'm using Framework 3.5) has any built-in support for such job? I need to add a automatic number for each letter that is made, so I need to grab the letter to add such info, before it can be saved/printed.

How will I handle the formating this way (bold, italic etc.)? By using Word formatting tags? If so, then I need a special priting module so it can fully understand the document's structure right?

Sorry for the noob questions I've never done anything similar.
 
Back
Top