title: Get print page count without printing the document
body: <p>This is somewhat similar to question about <a href="https://stackoverflow.com/questions/3137207/is-there-a-better-way-to-get-the-page-count-from-a-printdocument-than-this">Is there a better way to get the page count from a PrintDocument than this?</a></p>
  
  <p>But in my case I have a web-browser control with formatted html. At the moment I have option which calls <code>ShowPrintPreviewDialog()</code> so user can see how many pages going to be printed.</p>
  
  <p>Is there anyway to get the no of pages which going to be printed, without launching the <code>PrintPreview</code>? </p>
  
  <p>I am trying to create a method which will call <code>OnTextChange</code> and display print-page count automatically?</p>
  
  <p>I have use <code>PrintPage</code> event</p>
  
  <pre><code>private void PrintDocumentOnPrintPage(object sender, PrintPageEventArgs e)
   {
       e.Graphics.DrawString(this.webBrowser1.DocumentText, this.webBrowser1.Font, Brushes.Black, 10, 25);               
   }
  </code></pre>