maxfridbe
maxfridbe

Reputation: 5970

Printing page x of y in .Net

If I have a very large document to print and on each page of the document it needs to say "page x of y" Is there a way I could precalculate y without having to printing twice as offered as a solution here: http://bytes.com/topic/c-sharp/answers/862133-c-printing-page-count

I'm trying to avoid printing once, getting they y and then setting it, then printing again.

Upvotes: 1

Views: 881

Answers (1)

Robert Harvey
Robert Harvey

Reputation: 180787

No, because there's no way to know ahead of time how many pages your printout is going to take, without actually rendering the content.

You don't have to print it twice, you just have to simulate printing the first time.

Upvotes: 2

Related Questions