Printing doesn't work in Chrome 77 with client rendering

In Chrome 77 the behavior changed so that PDFs with auto-print enabled that are embedded in a web page no longer trigger the print dialog https://pdfium.googlesource.com/pdfium.git/+/2021804f1b414c97667c03d7ab19daf66f6a19ef

By default WebViewer has taken this approach in Chrome for printing when using client rendering since version 2.2.1, which is why you may see issues trying to print in Chrome.

Note that if you are loading XOD files, office files or using WebViewer server for rendering then you are not affected.

Solutions

Update to latest version

WebViewer versions 5.2.5 and higher contain a fix for this issue. If you update to the latest version this problem will be fixed. Download the latest version here.

Note that the fix is only applied to the default UI. If you're using the legacy UI or unable to update to the latest WebViewer version please use the workaround below.

Version 4+ with default UI

Call the instance.useEmbeddedPrint(false) function after WebViewer is ready.

In versions 5.1+

JavaScript

1WebViewer({
2 //...
3}, viewerElement).then(instance => {
4 instance.useEmbeddedPrint(false);
5});

In versions 4.x or 5.0

JavaScript

1const myWebViewer = new PDFTron.WebViewer({
2 // ...
3}, viewerElement);
4
5viewerElement.addEventListener('ready', () => {
6 myWebViewer.getInstance().useEmbeddedPrint(false);
7});

Version 2.2.1+ with legacy UI

Inside a config file

JavaScript

1window.isPDFiumSupported = function() {
2 return Promise.resolve(false);
3};

Outside a config file

JavaScript

1var myWebViewer = new PDFTron.WebViewer({
2 //...
3}, viewerElement);
4
5$(viewerElement).on('ready', function() {
6 var iframeWindow = viewerElement.querySelector('iframe').contentWindow;
7 iframeWindow.isPDFiumSupported = function() {
8 return Promise.resolve(false);
9 };
10});

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales