title: Label Printing From C# - Document Size Is Too Large For Printer
body: <p>I'm developing an application which must print labels. The label printer i'm using is a Brother QL-570. The label width is 66mm and the length of the labels needs to be approximately 45mm. The problem I'm having is that I am unable to configure the application to actually print the labels. Everytime I do so I receive a warning stating that the document size is too large for the printer. No matter what size I attempt to change the PrintDocument size to I always receieve a warning stating that the document is 90mm x 29mm and is too large for the label printer.</p>
  
  <p>Here's just one of my attempts:</p>
  
  <pre><code>private PrintDocument label;
  
  
  label = new PrintDocument();
  PaperSize pS = new PaperSize("Custom Size", 212, 67);
  label.DefaultPageSettings.PaperSize = pS;
  label.PrinterSettings.PrinterName = "Brother QL-570";
  label.PrinterSettings.DefaultPageSettings.PaperSize = pS;
  label.PrintPage += new PrintPageEventHandler(label_PrintPage);
  
  private void label_PrintPage(object sender, PrintPageEventArgs e)
  {
  
      SolidBrush brush = new SolidBrush(Color.Black);
      Font header = new Font(FontFamily.GenericSansSerif, 12.0F, FontStyle.Bold);
  
      e.Graphics.DrawString("Hello World", header, brush, 30, 30);
  
  }
  </code></pre>
  
  <p>Has anyone any idea where I'm going wrong?  I think I may be setting up the paper size for both the document and the printer incorrectly. I've tried numerous other paper sizes and to no avail.</p>
  
  <p>Thanks For Any Help.</p>