EFileTahi-A Posted July 13, 2009 Posted July 13, 2009 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. Quote
EFileTahi-A Posted July 16, 2009 Author Posted July 16, 2009 (edited) 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? Edited July 16, 2009 by EFileTahi-A Quote
Administrators PlausiblyDamp Posted July 16, 2009 Administrators Posted July 16, 2009 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
EFileTahi-A Posted July 16, 2009 Author Posted July 16, 2009 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.