title: C# Application to Print Excel - NPOI Print Setup to set to legal pager size in excel
body: <p>I have a C# application that is using the NPOI library version 2.3.0.0.  I want to print an excel document with the default print dialog settings pager size set to Legal Paper.</p>
  
  <p>I've done the following in code xlsx is an IWorkbook and sheet is ISheet.</p>
  
  <pre class="lang-cs prettyprint-override"><code>var sheet = xlsx.CreateSheet("Statement");
  
  sheet.PrintSetup.PaperSize = (short)PaperSize.US_Legal; 
  </code></pre>
  
  <p>I expect when I go to Print that the Settings show as Legal and not as Custom Paper Size.  But this isn't the case.  Can someone fill me in on why I'm not getting the Legal Paper size to be set?</p>