window.print() is not working in Microsoft Edge browser

Issue #17148061 • Assigned to Steven K.

Details

Created
Apr 23, 2018
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

We are calling window.print() from the javascript to open operating system printer dialog box. Most of the times, printer dialog box is not opening. It works well in Internet Explorer, Issue is only with Microsoft Edge browser.

When we look into the console logs using Developer Tools(F12). we got the below exception,
SCRIPT65535: Unexpected call to method or property access.
preview.js (358,1)
Line No 358 in preview.js --> Printer.startPrint();

Note : when we click print in our web page, new tab will open and in that page onload function from javascript is called, and inside onload function window.print() is called to open the operating system printer dialog box.

Edge Version:
Microsoft Edge 40.15063.0.0
Microsoft EdgeHTML 15.15063

My code snippet :
first.html
<html>
<script language="JavaScript">
function openPageTwo()
{
window.open('two.html’,’PopupPage’, ‘height=800,width=950,scrollbars=yes,resizable=yes,menubar=1’);
}
</script>
<a href="javascript:openPageTwo()">Open Page Two</a>
</html>

two.html
<html>
<script language="JavaScript">
window.onload = function()
{
window.print();
}
</script>
<p>my content
</html>

when we click “Open Page Two” sometimes operating printer dialog box is opening but most of the times it is not opening.

below is the console error in developer tools,
SCRIPT65535: Unexpected call to method or property access.
preview.js (358,1)
Line No 358 in preview.js --> Printer.startPrint();

Any help would be greatly appreciated

Attachments

0 attachments

    Comments and activity

    You need to sign in to your Microsoft account to add a comment.

    Sign in