C# PrintDocument prints blank page. Why?

c#

Solution

You need to actually draw the image:

private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
  e.Graphics.DrawImage(picpdf417.Image, Point.Empty);
}

Problem

I have the following picture box I populate with a barcode then try to print. Here's the code: ``` private void button1_Click(object sender, EventArgs e) { printDocument1.OriginAtMargins = true; printDocument1.DocumentName = "TEST IMAGE PRINTING"; printDialog1.Document = printDocument1; printDialog1.ShowDialog(); printDocument1.Print(); } private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e) { System.Drawing.Graphics formGraphics = System.Drawing.Graphics.FromImage(picpdf417.Image); } ```

Original source