tags:

views:

40

answers:

1

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.

A: 

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.

Robert Harvey
Right. but is there maybe a way to precompile these pages and fill in the page.
maxfridbe
That's what you would be doing if you spin thru the pages in a Print Preview type of action.
Robert Harvey