title: How to print in C# html document in ONE page
body: <p>How to print in C# html document in ONE page on windows printer?
  I need to print bill with different length and it must be at one page.
  But in my example with many amount of strings in bill it is separate to few pages.</p>
  
  <p>I was use this example of code for printing html:</p>
  
  <pre><code>private void PrintHelpPage()
  {
      // Create a WebBrowser instance. 
      WebBrowser webBrowserForPrinting = new WebBrowser();
  
      // Add an event handler that prints the document after it loads.
      webBrowserForPrinting.DocumentCompleted +=
          new WebBrowserDocumentCompletedEventHandler(PrintDocument);
  
      // Set the Url property to load the document.
      webBrowserForPrinting.Url = new Uri(@"\\myshare\bill.html");
  }
  
  private void PrintDocument(object sender,
      WebBrowserDocumentCompletedEventArgs e)
  {
      // Print the document now that it is fully loaded.
      ((WebBrowser)sender).Print();
  
      // Dispose the WebBrowser now that the task is complete. 
      ((WebBrowser)sender).Dispose();
  }
  </code></pre>
  
  <p>I know how to read hight of my page from WebBrowser control
  wb.Document.Body.ScrollRectangle.Height</p>
  
  <p>And try to change dimensions of page by few different ways:</p>
  
  <pre><code>PrintDocument pd = new PrintDocument();
  PaperSize pkCustomSize1 = new PaperSize("First custom size", 310, 250);
  
  pd.DefaultPageSettings.PaperSize = pkCustomSize1;
  System.Drawing.Printing.PaperSize("Custom Paper Size", 250, 550);
  
  pd.SDefaultPageSettings.PaperSize.Kind = PaperKind.Custom;
  pd.DefaultPageSettings.PaperSize.Height = 1633;
  </code></pre>
  
  <p>But it still separate to few pages while printing.
  Thanks</p>