I want to print some formatted text using C#. the text is something like this:
Hi i am a Multi-line partially formatted text. I want to be printed using C#(winforms). I might contain some unicode text like مرا به هیچ بدادی و من هنوز بر آنم/ که از وجود تو مویی به عالمی نفروشم and so on....
PDFsharp is the Open Source .NET library that easily creates and processes PDF documents on the fly from any .NET language. The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer
You can create an XGraphics object from a Graphics object:
XGraphics gfx = XGraphics.FromGraphics(graphics, size);
So if you have a Graphics object for a printer, you can use PDFsharp code for printing.
Not sure if it can be of help for you, as the Graphics object can be used for printing directly.
Using XGraphics makes sense if you need PDF and printing or PDF and screen preview.