Hey all. I have written this very useful class called CPrint. It is derived from CPrintDialog and is a very simple solution to printing multi-formatted text documents with as little as three lines of code. Moreover, it is device independent and thus is consistent across all printers.
A sample file is included, but is as simple as this:
And that's it! I'm hoping someone else will find it useful as I remember how I struggled when I was first trying to send something useful and decent looking to a printer without a ton of code.Code:#include "CPrint.h" ... CPrint dlg; if (dlg.InitPrintJob()) { dlg.PrintLine("Here's the title of my document!", PA_HSPACE); dlg.PrintLine("Blah blah blah... The quick brown fox, etc"); dlg.ConcludePrintJob(); } ...
Aside from just printing you can do most necessary tasks to make print jobs attractive, like changing fonts (face, size, italic, bold, underline, strikeout). In addition it was designed with inheritance in mind so you can design much more complex print classes.
Let me know what you think... (even if you think it's a pile of crap)
Thanks.



LinkBack URL
About LinkBacks



perator new(unsigned int)" (??2CObject@@SGPAXI@Z) already defined in CPrintLib.lib(CPrint.obj)