Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing in Chrome is loading preview forever [closed]

On my website, printing has stopped work with Google Chrome (version 81 on Linux, if that matters). The print preview window is stuck with showing "Loading preview...".

While doing this, Chrome prints the following message on the console:

[30378:30378:0424/004907.441044:ERROR:CONSOLE(2990)] "Uncaught TypeError: Cannot read property 'marginTop' of null", source: chrome://print/print_preview.js (2990)

When I open the developer tools and set the CSS media type emulation to "print", the page is shown correctly as it would be printed, and there are no errors in the console.

How can I find out where the problem comes from and how to fix it?

like image 258
Bob Avatar asked Apr 23 '20 22:04

Bob


People also ask

How do I fix print preview in Google Chrome?

If your Chromebook can't load the print preview, restart your laptop, printer, and router. Additionally, remove and set up the printer again. If the issue persists, clear your Chrome cache, and disable your extensions. You can also reset your browser to default settings.

Why does my Google Chrome keep saying preview?

It has to do with if Chrome initially shows you a page preview (e.g., if web connection is initially unreliable, or if the website's server is delayed). You'll see "Preview" appear in the URL bar when this happens.

How do I get print preview back?

Click File > Print. On the right, you'll see a preview of your file.


1 Answers

Resetting Chrome did not solved the issue in my case, I had to disable the Print Preview by adding a key in Windows registry.

As written in Pupuweb.com

Previously this print preview loading problem was able to resolve by disabling it in chrome://flags/#enable-cloud-printer-handler. However, enable-cloud-printer-handler, however it was removed in Google Chrome Version 84.

So to disable the Print Preview feature I had to add at HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome a DWORD value named DisablePrintPreview with data 1, restart the machine and could start print again.

If you don't have the GPO Templates for Chrome you can create the keys manually or with the following line.

reg add HKLM\SOFTWARE\Policies\Google\Chrome

To add the value in command line, run as administrator the following line.

reg add HKLM\SOFTWARE\Policies\Google\Chrome /v DisablePrintPreview /t REG_DWORD /d 1 /f

Create a registry file ".reg" and add the following, run as administrator.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
@=""
"DisablePrintPreview"=dword:00000001
like image 135
André M. Faria Avatar answered Oct 12 '22 23:10

André M. Faria