How to get: Page # of ???

  • Thread starter Thread starter Mr. B
  • Start date Start date
M

Mr. B

In VB.net, if you set up a print routine... and all works fine (including a
print preview)... setting the Page # (1, 2, 3, 4, etc) is easy.

HOW can you get the final number of pages? Such as Page 1 of THREE?

I know you can get the final number once the routine has gone through each
page... but what I want to know is how to ADD the number of pages to be
printed to each page (page 1 of 3, page 2 of 3...).

I'm not clear IF one can add the total pages to your pages or not.

(am I making sense?) (:

Thanks!

Bruce
 
* Mr. B said:
In VB.net, if you set up a print routine... and all works fine (including a
print preview)... setting the Page # (1, 2, 3, 4, etc) is easy.

HOW can you get the final number of pages? Such as Page 1 of THREE?

I know you can get the final number once the routine has gone through each
page... but what I want to know is how to ADD the number of pages to be
printed to each page (page 1 of 3, page 2 of 3...).

I'm not clear IF one can add the total pages to your pages or not.

You will have to print (without actually printing) in order to get the
number of pages. Then you will have to print the document again, as
described by you including the number.
 
You will have to print (without actually printing) in order to get the
number of pages. Then you will have to print the document again, as
described by you including the number.

Nutz... Okay... thanks! I was hoping for a 'built-in' solution. Rather than
re-run the print, fortunately I know how many 'items' per page I will allow to
have (ie: say 15)... so knowing my total, I can then just do the math and
determine how many pages I'll have (tried it and it works).

Regards,

Bruce
 
* Mr. B said:
Nutz... Okay... thanks! I was hoping for a 'built-in' solution. Rather than
re-run the print, fortunately I know how many 'items' per page I will allow to
have (ie: say 15)... so knowing my total, I can then just do the math and
determine how many pages I'll have (tried it and it works).

That's the best (and only) way.

;-)
 
Mr. B said:
With Deft Fingers, (e-mail address removed) (Herfried K. Wagner



Nutz... Okay... thanks! I was hoping for a 'built-in' solution.
Rather than re-run the print, fortunately I know how many 'items' per
page I will allow to have (ie: say 15)... so knowing my total, I can
then just do the math and determine how many pages I'll have (tried
it and it works).

Hehehehe.... Make sure you test what happens if the extra character ( ie
"Page 9" vs "Page 10") in some imbedded text somewhere causes (column /
widow /orphan) overflow to the next page, causing everything to change
again. I implemented this in the early 1980's in a "word processor" whose
back end was Xenix FoxBASE. The loop was basically

REPEAT
format, format, format, format, ....
SAVE
UNTIL NO MORE CHANGES
PRINT (The Final Copy Of Everything)


IMO MS Word doesn't do as well. With versions and two side printing I've
had display and/or printing errors in *every* version I've used (MS Word 2.0
to 2002.)

The general case of "See Figure xxx on page yyyy" IS NOT EASY!!! There may
be no "100% correct" solution, especially with proportional fonts. My
algorithms identified threashing and inserted an arbitrary space to work
towards a solution.

-- Mark
 
Back
Top