diff --git a/web/app.js b/web/app.js
index fe557a77f..0c35c5719 100644
--- a/web/app.js
+++ b/web/app.js
@@ -1225,9 +1225,6 @@ const PDFViewerApplication = {
     });
 
     pagesPromise.then(async () => {
-      if (!this.supportsPrinting) {
-        return;
-      }
       const [openAction, javaScript] = await Promise.all([
         openActionPromise,
         pdfDocument.getJavaScript(),
@@ -1259,6 +1256,9 @@ const PDFViewerApplication = {
         }
       }
 
+      if (!this.supportsPrinting) {
+        return;
+      }
       if (triggerAutoPrint) {
         setTimeout(function() {
           window.print();