Re: Printing from winforms..
Here's a printing snippet I use in some of my code:
In some Print button, do the following:
Code:
//Setup and print the document
PrintDocument document = new PrintDocument();
PageSettings pgSettings = new PageSettings();
document.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
document.DefaultPageSettings = pgSettings;
PrintDialog dlg = new PrintDialog();
dlg.Document = document;
if (dlg.ShowDialog() == DialogResult.OK)
{
document.Print();
}
Then create a print event where you "draw" your print output:
Code:
private void pd_PrintPage(object sender, PrintPageEventArgs e)
{
//Print finished bitmap
Point point = new Point(0, 30);
e.Graphics.DrawImageUnscaled(PrintReadyBitmap, point);
}
In my case, im printing a bitmap.
You may also consider using a webbrowser control to construct your document in HTML, and then calling the browsers print methods.
-CSixx