CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Posts
    3

    Unable to get correct total number of pages while printing multiple copies

    I am using windows print spooler notification functions, as FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification to get JOB_NOTIFY_FIELD_TOTAL_PAGES, JOB_NOTIFY_FIELD_PAGES_PRINTED values. Normally it is getting the total pages printed. But when I am printing multiple copies (>1) of the selected page, it is not giving total number of pages printed but number of pages of the document being given for the print.

    Kindly help me... please!!!!!!!!!!

    With thanks & regards
    Mukul Kumar

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Unable to get correct total number of pages while printing multiple copies

    Quote Originally Posted by mukulkumar View Post
    Kindly help me... please!!!!!!!!!!
    Help you with what?
    Perhaps you should just multiply the "number of pages of the document being given for the print" by number of copies?
    Victor Nijegorodov

  3. #3
    Join Date
    Jun 2013
    Posts
    3

    Re: Unable to get correct total number of pages while printing multiple copies

    Its kind of you to respond to my query, Sir.

    I think I lack some where to communicate my problem to you all.

    Taking an example, if I have a document of 10 pages and I give a print of more than 1 page of the document, (eg. Page 1, 4) asking for 4 copy each then the return value I obtain is:

    JOB_NOTIFY_FIELD_PAGES_PRINTED = 8
    JOB_NOTIFY_FIELD_TOTAL_PAGES = 2

    But, if I give print of a selected single page (or current page) and ask for 4 copies of it, then the return value I obtain is:

    JOB_NOTIFY_FIELD_PAGES_PRINTED = 1
    JOB_NOTIFY_FIELD_TOTAL_PAGES = 1

    But, the printing does takes place in all the printers (Epson/ HP/ Canon) I have tried.

    I do feel, that printer setting is having some influence over my result. Frankly, I don't know.

    The printer setting are as follows:
    Priority: 1
    Selected: Spool print documents so program finishes printing faster
    Selected: Start printing after last page is spooled

    Selected: Print spooled documents first
    Selected: Enable advance printing features

    It would be really kind of you to give your guiding suggestions.

    With thanks
    Mukul Kumar

  4. #4
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Unable to get correct total number of pages while printing multiple copies

    it really depends on who manages the copies.

    some printers simply let the driver handle this and require that you actually "print" each individual copy.
    While other printers handle this in the hardware where you only "print" a single compy and the printer outputs it several times.

    The job notifications are about what windows sent to the printer, not what the printer is actually doing.

  5. #5
    Join Date
    Jun 2013
    Posts
    3

    Re: Unable to get correct total number of pages while printing multiple copies

    Thanks for guiding, Respected Sir. So, under the given circumstances I can not get the copies detail from the printer, and under the constraints I can only disable the copies option of the Print Dialog, so that user can not go to get multiple copies of the intended pages.

    I am new to windows programming, it would be really kind of you to extend your valuable support and guidance to disable the copies option of the Print Dialog at the runtime.

    With thanks and regards,
    Mukul Kumar

  6. #6
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Unable to get correct total number of pages while printing multiple copies

    ...So, under the given circumstances I can not get the copies detail from the printer...

    Correct, to a degree. The printer might have some feedback API to show what it is actually doing, but this is going to be printer/manufacturer dependent.
    Typically speaking, a "print job" for windows ends when the printout has been to the spooler and eventually to the printer. Windows doesn't really manage individual pages in a printout. The only reason you see this happening in "cheap" off the shelf printers for the typical consumer market is because those printers tend to only have enough memory for a single page. So as the data is printed, the sending to printer "blocks" because memory is full giving you the false impression Windows (actually the printer driver) is actually handling individual pages.

    On large bussiness oriented printers there is often a large buffer (even harddisks) in the printer to store prints. You typically send the entire multipage print at once, and it's stored on the printer. Actual printing doesn't start until the entire job has been spooled, and even in this case, it's often just put in a holding queue until you actually go to the printer, and select your item from the queue. You can often even keep an item stored for printing again later.

    ...under the constraints I can only disable the copies option of the Print Dialog...
    This may not even work. On the printer we have in the office, the number of copies on the default printerdialog isn't used, there's a "number of copies" and lots of other print options hidden behind the "preferences" button on the default printdialog. That works independant of the default setting.

    You can use the "number of copies" in the printdialog as well, but we've learned not to, because doing it that way, bypasses all the sorting options in the printer (put each copy in an individual pile, or put each copy in a separate sort basket, or put a staple in each pile, ...).


    basically... don't worry about it, and don't expect to get that kind of control over the printout. It shouldn't matter anyway, and if it does, you're probably doing something the wrong way or trying to do something that just can't be guaranteed in Windows.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured