I am using a PrintDialog and PrintDocument in c# windows application, WinForms, to print a document.
Printing working fine but I want to display the document before printing, so that I can check if PointF for DrawString is like I want it.How I can do that? Is there any tool that make it easy to define a pointF on A4 document?
private void buttonPrintShows_Click(object sender, EventArgs e)
{
PrintDialog pd = new PrintDialog();
pd.Document = printDocumentStatistic;
if (pd.ShowDialog() == DialogResult.OK)
{
printDocumentStatistic.Print();
}
}
private void printDocumentStatistic_PrintPage(object sender, PrintPageEventArgs e)
{
e.Graphics.DrawString("Shows:",new System.Drawing.Font("Arial", 20f), new SolidBrush(Color.Red), new PointF(35, 50));
e.Graphics.DrawString("Act:", new System.Drawing.Font("Arial", 20f), new SolidBrush(Color.Red), new PointF(35, 75));
e.Graphics.DrawString(show_name, new System.Drawing.Font("Arial", 20f), new SolidBrush(Color.Red), new PointF(100, 50));
e.Graphics.DrawString(akt_name, new System.Drawing.Font("Arial", 20f), new SolidBrush(Color.Red), new PointF(100, 75));
}