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