Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11 Windows 7 Print issue after kb4021558

Tags:

Apologies for the slightly vague question but I'm pulling my hair out. Since this update we have had numerous calls regarding printing from our web app. Our web app uses an iframe and we use css @media print to hide all but this iframe for printing purposes. Since the update the user receives an Error 404--Not Found instead of the actual page. It would seem from the network trace that IE creates a temp .htm file in the local directory like D3CD911.htm, it then downloads css/js resources and then finally it makes this call /D3CD911.htm. This is making a call to www.mywebsite.co.uk/D3CD911.htm. This obviously does not exist on the website so the 404 is returned. I struggling to find a pattern to the problem and it doesn't seem to be affecting other public sites. I think the issue is with window.print() method. I can semi reproduce it here at https://www.primefaces.org/showcase/ui/misc/printer.xhtml. If you click the print button you will get the error. Although this is using the jqprint javascript function if you then use the browser print button it also fails.

Any guidance would be much appreciated.

like image 311
andyfinch Avatar asked Jun 14 '17 14:06

andyfinch


People also ask

How do I change print settings in IE 11?

In IE11 , by selecting File Menu > Print Preview displays a new window where we can visualize and modify print settings, level of zoom we'd like to use or even select "Shrink to fit" or a custom percentage.

Do you know how do you resolve print preview in Internet Explorer is not working?

Click the Security tab and uncheck the checkbox beside Enable Protected Mode (requires restarting Internet Explorer) Click Apply , and then click OK. Close all open Internet Explorer windows, and then restart Internet Explorer. Browse to a website and try test printing a page while running as the Administrator.

How do I enable print on Internet Explorer?

Print pages by pressing Crtl + P on the keyboard or select the Tools button > Print, and then choose Print.

How do I print from IE11?

Click the “Tools” button in the upper-right corner, roll over the “Print” command, and then select the “Print…” command in the side menu that appears to open the “Print” dialog box.


2 Answers

andyfinch, you're a genius! The following code appears to work for a print button contained within a frame:

function Print() {   if (document.queryCommandSupported('print')) {     document.execCommand('print', false, null);   }   else {     window.parent.<framename>.focus();     window.print();   } } 
like image 66
Thom Avatar answered Sep 29 '22 18:09

Thom


Update: Microsoft have now released a patch: Microsoft IE patch

Just wanted to summarise the workarounds I've found and which have been posted here.

1) If you are using your own print button change to use document.execCommand('print', false, null);. Test support using document.queryCommandSupported('print') and call window.print() if not supported (Prob just Firefox)

2) Use Print Preview. Additionally select the part of the page to print, right click and select print preview. Then select As selected on screen.

3) Use another browser like Chrome

4) Uninstall the update

5) Wait for Microsoft fix. Their KB page KB Link has been updated with this as a known issue. Therefore you assume a fix is on the way.

like image 30
andyfinch Avatar answered Sep 29 '22 16:09

andyfinch