473,395 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 965
* 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sentinel | last post by:
Hi, Wonder if anyone can help with this problem: I am using an app with several pages, using a session to track vars between the pages, and using an image map to re-direct back and forwards...
4
by: Michael J. Astrauskas | last post by:
Does anyone have a function for manipulating GET variables in a URL? I want to be able to modify some parameters without affecting others. An example of what I'm looking for: Let's say the...
4
by: Dariusz | last post by:
I have constructed a PHP generated HTML layout, which on POSTing the menu option the user selects, calls the same PHP code / page which generates the HTML page and GET's the correct SHTML page into...
3
by: Dariusz | last post by:
I have a problem where I need to pass two variables using GET from a form I have, to solve a page selection problem I have. The code is written that if a new visitor arrives at the front page of...
24
by: el_roachmeister | last post by:
Is there a way to make a text link post to a form without passing all the parameters in the url? The urls tend to get very long and messy. I often wonder if there is a limit to how long they can...
4
by: Paul | last post by:
Hi, I'm wondering if someone out there can help me overcome this quandary. I need to be able to calculate the height of the current page. I need to calculate the height of the page in pixels after...
4
by: Christine Forber | last post by:
I have a page with a number of images. Before each image, there is a link <a name="#image_id"></a> with the appropriate image_id value. The page can be reached by way of a GET form. The question is...
1
by: Ersin Gençtürk | last post by:
We couldn't find why these errors happen.They doesn't appear everytime.And they appear different pages at different times.Is there somebody know why these happenes ? First user gets this error :...
1
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle...
7
by: nicknack | last post by:
Hi. I have a strange problem wuth IFRAME. I have page aaa.aspx with an IFRAME that contain page bbb.aspx. page bbb.aspx sometimes redirect him self to page ccc.aspx. The problem is that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.