how to catch print error in javascript

Discussion in 'JavaScript' started by varunpathak, Dec 12, 2009.

  1. #1
    I am printing the page directly without showing the print dialog via javascript ,
    But I am not able to catch the error if the page is not printed .

    I have tried onbeforeprint and onafterprint event in IE but they both are fired even if there is an error .

    kindly help me.

    I want to show some alert message if the page is not printed

    is there any property or logic that I can use
     
    varunpathak, Dec 12, 2009 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    you can't really know the success of the print job as it goes to the spooler.

    http://jsprintsetup.mozdev.org/reference.html is a great plugin for print control for firefox - if what you are developing is a CMS and can pick a "required" browser. obviously, if it's customer facing, that won't work.

    you can get some feedback of what you are printing using the .setShowPrintProgress(true); method.
     
    dimitar christoff, Dec 12, 2009 IP