CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2007
    Location
    Bulgaria
    Posts
    4

    Question How to find out the printer has finished?

    Hi All,

    I'm creating a windows forms application.
    I do printing in it.
    I need to know exactly when the printer has finished printing and how.
    I tested many codes but found no solution for it.
    Could you please help me solve this issue?

    Thanks in advance!

  2. #2

    Re: How to find out the printer has finished?

    Hello,

    If .net technologies are being used then a "PrintSystemJobInfo" object contains an "IsCompleted" member that returns a boolean value.

    There is also an "EndPrint" event - part of the PrintDocument class that might be useful

    Peter

  3. #3
    Join Date
    Aug 2007
    Location
    Bulgaria
    Posts
    4

    Re: How to find out the printer has finished?

    Hi Peter,

    I do know about that, but my target is detecting when exactly phisical printer completes printing.
    EndPrint event has been raised when last printer page is rendered on the printer's graphics.
    But it still far away from the printer itself.
    Using IsCompleted of PrinterJobInfo I see a print job as completed right away it has been sent from printer spooler to the printer, but printer may be out of paper so it is actually is not completed.

    Thank you

  4. #4

    Re: How to find out the printer has finished?

    Hello,

    There's also a "GetJob" API call:

    http://msdn.microsoft.com/en-us/libr...94(VS.85).aspx

    To use it though, you need to have a JobId number that is for your document being printed - it should hopefully return "JOB_STATUS_PRINTED" as part of the JOB_INFO structure when document is finished.

    Peter

  5. #5
    Join Date
    Jun 2009
    Posts
    113

    Unhappy Re: How to find out the printer has finished?

    The only absolute way to determine if the printer has finished is to ask it - which I'm afraid is outside of driver / spooler control. You'll need to use an SNMP query to the device.

  6. #6
    Join Date
    Aug 2007
    Location
    Bulgaria
    Posts
    4

    Smile Re: How to find out the printer has finished?

    Hi the_cat,

    I wanna know if SNMP is possible for USB printers.
    I also need some sample code.

    Regards

  7. #7
    Join Date
    Jun 2009
    Posts
    113

    Re: How to find out the printer has finished?

    SNMP is not supported for USB so you would need another method. Maybe look into retrieving the printed status from the printer through PJL as USB is bi-directional? I don't have any sample code but check out this website http://www.undocprint.org/start which has links to not only USB but also the Printer Job Language (the manual for which can be downloaded from HP: http://spp.austin.hp.com/SPP/Public/...cDownload.aspx )

  8. #8
    Join Date
    Dec 2004
    Location
    Shanghai
    Posts
    20

    Re: How to find out the printer has finished?

    oh, you can use JOB_INFO2
    Robert Wan
    MSN: microtimesoft@hotmail.com
    SKYPE: microtimesoft
    Site: www.r7tech.com

Tags for this Thread

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