Ken

Ken

  • NA
  • 110
  • 0

Augh! Blank pages when printing

Dec 31 2011 2:37 PM
I am trying to print a receipt.  Very basic, don't want a print preview or anything like that.  Just want to hit the receipt button in the form and have it spit one out.  It works, but prints 2 pages every time - one with data, one blank.  This is what I have:

private void button3_Click(object sender, EventArgs e) {
  TextBox receipt = new TextBox();
  receipt.Text = "I hate print problems" + Environment.NewLine;
  PCPrint printeng = new PCPrint();
  printeng.PrinterFont = new Font("Courier New", 10);
  printeng.TextToPrint = receipt.Text;
  printeng.PrinterSettings.FromPage = 1;
  printeng.PrinterSettings.ToPage = 1;
  printeng.Print();
}

I threw in the frompage/topage in hopes that would work, but it still cranks out two pages.  I had read that if the data is too large it can cause this, so I removed the meat of the receipt and just put that one line of text and I still get two pages.

Any ideas?

Answers (10)