ideal savran said:
hello
How can I calculate total of pages before printing the all type of
document(.pdf,word,excel,txt...) in a directory with c#.
thank you..
Firstly, see Peter's reply as I think he's summed it up quite nicely.
Depending on why you want this, you might find that there are alternatives
available out there already which will do what you want. For instance if you
wanted to know how many pages would be printed for your own benefit before
committing to print then I'd suggest looking at FinePrint (
http://fineprint.com/fp/ ), that lets you preview what you are printing,
giving you the total number of pages, letting you print 2 up, 4 up etc and
the ability to delete pages you don't what.
If on the other hand you really do want your own application to give a total
number of pages, then there is no easy answer.