Click here to Skip to main content
12,295,457 members (56,603 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
how to count pages we are going send to the printer...?
Posted 30-Dec-12 23:42pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

try this..
public static int GetPageCount(PrintDocument printDocument)
{
    int count = 0;
    printDocument.PrintController = new PreviewPrintController();
    printDocument.PrintPage += (sender, e) => count++;
    printDocument.Print();
    return count;
}
  Permalink  
Comments
Prabath Manjula 31-Dec-12 7:25am
   
what is the parameter called printDocument...? and how I called this. I want create application which can count number of pages what we going to print.

when we going to print any documents, the program can count the pages. please give me a tip for this...?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100