[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

question about printing the total pagecount on the separator page

Posted on 2004-09-19
6
Medium Priority
?
738 Views
Last Modified: 2012-05-05
I am trying to print a total page counts on the separator page (.SEP file).
What code will allow me to print this counts?  Any suggestion?

Thank you,

Evan
0
Comment
Question by:evansong
  • 4
5 Comments
 
LVL 39

Accepted Solution

by:
hdhondt earned 1400 total points
ID: 12100766
The following commands, inserted above the line that says @Lshowpage in SYSPRINT.SEP should print the postScript page count, if you precede each line with the @L separator command:

/TotalPages {
    statusdict/pagecount get exec(                )cvs
     }def
    flush

200 200 moveto
/Times-Roman findfont .5 72 mul scalefont setfont
TotalPages show

i.e. the last line should really read "@LTotalPages show". Leading spaces and blank lines are not important and can be left out. The "200 200 moveto" positions the text in points (1 inch = 72 points) and can be changed to suit. The font can also be changed easily. Note that PostScript is case sensitve.

Note that the PostScript pagecount is *not* the total number of pages the printer has actually printed. It is just the number of pages it has been instructed to print, disregarding cancelled jobs and other mishaps.
0
 

Author Comment

by:evansong
ID: 12107774
Hi hdhondt,

WOW, it works like a charm.  And yes, it does not print the total number of pages the printer just printed.  Is there a way to know how many pages are in que?? and then print that in separator page?

Evan
0
 
LVL 39

Expert Comment

by:hdhondt
ID: 12109055
No, the printer does not know how many pages are in the queue. Without parsing the entire PostScript file, the server does not know either. If you did that you could extract the page count and pass it on to the separator page.

Some printers have hardware counters that give a more accurate idea of the real number of pages printed to date. These may or may not be accessible from PostScript. Some printers also have built-in job logging, where the printer stores the user name, file name, etc as well as the number of pages & page size for each job. Xerox printers usually have this feature - you access it by pointing your web browser at the printer's IP address.
0
 
LVL 39

Expert Comment

by:hdhondt
ID: 12159048
Some utilities like GhostScript (freeware) can tell you how many pages are in the job. However, using Windows, the problem is to interface this with the print spooler. If you were running unix it would probably not be very difficult to get GhostScript to write the number of pages to a file (or a pipe) and include the result on a separator page. It would of course impact total system performance as the server has to parse every print job from start to finish in order to compute the number of pages.

There are also (expensive) print management software packages that will do this.
0
 
LVL 39

Expert Comment

by:hdhondt
ID: 12387753
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave a recommendation in the Cleanup topic area that this question is:
Accept hdhondt
Any objections should be posted here in the next 4 days. After that time, the question will be closed.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

hdhondt
EE Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This seems to be a very common error related to the Samsung printer driver. First, this is the error we're talking about: Log: System Type: Error Event: 7000 Agent Time: 3:37:24 am 22-Apr-09 Event Time: 6:07:24 pm 21-Apr-09 UTC Source: Se…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question