Chrome browser becomes non responsive while executing window.print() RRS feed

  • Question

  • Hi All,

    As silverlight printing is pretty slow when Non POS Printer is selected, As a alternate we are printing using javascript.  Silverlight application passes content to be printed to javascript. In Javascript i am writing whole content into a window and call window.print(). 

    Silverlight code:

    string template = "<table style=\"width:600px;\"><tr><td>Test1</td><td>Test2</td><td>Test3</td></tr><tr><td>Test4</td><td>Test5</td><td>Test6</td></tr></table>";
    HtmlPage.Window.Invoke("TestPrint", template);

    Javascript code:

    function TestPrint(strParamGGS) {
                   var w1 = window.open("", "", "width=600, height=400");

    The above code works fine in IE,firefox but in Chrome (version  43.0.2357.124) when w1.Print(); is called, UI hangs out and print preview window is also not displayed. 

    The above javascript code works fine in chrome when called from HTML button click.

    Please let me know how to fix the above issue.

    Monday, June 15, 2015 8:25 PM


All replies

  • Hi RaghuK,

    Please verify whether your Chrome browser enable Silverlight plug-in? In April 2015 NPAPI support have been disabled by default in Chrome and in September 2015 NPAPI will be permanently removed from Chrome, which you could read from this blog . I suggest you run your Silverlight application with IE or Firefox.
    Please copy https://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx to Chrome address bar, if you get this message : "You are running on a browser that may not be fully compatible with Microsoft Silverlight.", it means the NPAPI is disabled by Chrome. Please enable NPAPI as follow steps:
     1) Type "chrome://flags/#enable-npapi " in the address bar
     2) Find the "Enable NPAPI"
     3) Click "Enable"
     4) Restart Chrome

    Best Regards,

    Tuesday, June 16, 2015 8:36 AM
  • I would have thought he/she might have noticed if Silverlight wasn't there at all in order to click the button/whatever and initiate the process.

    But... there is now 3 months before Google push out a version of Chrome which won't allow Silverlight to work at all.

    I would have thought that means it's a bit academic how slow Chrome is and time to change to a different browser.

    Or convert the whole thing to asp.net.

    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles

    Tuesday, June 16, 2015 8:43 AM
  • Hi RaghuK,

    I will mark Andy's post as answer, if this doesn't give you any help, please feel free to let me know and follow up.

    Best Regards,

    Thursday, June 25, 2015 2:24 AM
  • Hi Andy,

    Thanks for the suggestion. But this is not a solution for the problem.



    Thursday, June 25, 2015 7:28 PM
  • Hi RaghuK,

    Your issue is caused by the window.close(). Please try to close the print window manually.

    function printPage(){
         * wait 10 seconds before window.close()
        }, 10000); 

    If it doesn't work, please refer following thread that similar with your problem.


    If you have solved, please share your solution with other commities. Thank you.

    Best Regards,

    Friday, June 26, 2015 1:47 AM