Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to count pages we are going send to the printer...?
Posted

1 solution

try this..
C#
public static int GetPageCount(PrintDocument printDocument)
{
    int count = 0;
    printDocument.PrintController = new PreviewPrintController();
    printDocument.PrintPage += (sender, e) => count++;
    printDocument.Print();
    return count;
}
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900