470,632 Members | 2,706 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,632 developers. It's quick & easy.

How to get: Page # of ???

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
Nov 20 '05 #1
4 920
* Mr. B <Us**@NoWhere.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
With Deft Fingers, hi***************@gmx.at (Herfried K. Wagner [MVP]) wrote:
HOW can you get the final number of pages? Such as Page 1 of THREE?
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
Nov 20 '05 #3
* Mr. B <Us**@NoWhere.com> scripsit:
HOW can you get the final number of pages? Such as Page 1 of THREE?

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).


That's the best (and only) way.

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Mr. B wrote:
With Deft Fingers, hi***************@gmx.at (Herfried K. Wagner
[MVP]) wrote:
HOW can you get the final number of pages? Such as Page 1 of THREE?

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).


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
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by sentinel | last post: by
4 posts views Thread by Michael J. Astrauskas | last post: by
3 posts views Thread by Dariusz | last post: by
24 posts views Thread by el_roachmeister | last post: by
4 posts views Thread by Christine Forber | last post: by
1 post views Thread by Ersin GenÁtŁrk | last post: by
7 posts views Thread by nicknack | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.