The included .jpg shows a page that was created with a PrintDocument object. My problem is that some words in the portion that is marked with a red rectangle needs to be formatted with Bold, Italic and Underline characters.
Since the formatting is simple, I first tried using my own formatting tags and work from there. Not as easy as I thought.
I chose that recipe because I tried it last weekend, and it is a very good one for your taste buds (at least mine). So those of you who understand French can try it :-). Unfortunately most of the recipes used by the application have paragraphs that takes more than one line, and I need to handle word wrapping of the text so that it fits in the width of the page.
While word wrapping is quite easy to handle when all the text uses the same font, things get a lot more complicated when italic text is slightly larger, and bold text is about 30% wider than the same text in normal font.
To summarize, it can be done, but with pain that I would prefer not to endure. In my opinion, a good programmer is a lazy programmer. He does not work less than another one, but he does more during the same number of work hours. Since I see myself as a decent programmer, I am a bit lazy.
I then tried implementing the formatting in rtf, but found out that the PrintDocument cannot handle rtf by itself.
I tried displaying the rtf in a RichTextBox and insert a snapshot of that RichTextBox in the PrintDocument, but the quality is not good enough compared to the text in the rest of the document.
Did anybody ever had to format rtf text inside of a PrintDocument Page, or have an idea on an easy way to do it?
Thank you all.