From 3721a4d9a2d0064669022f3f31dce2d5a201180a Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 4 Dec 2021 11:27:04 +0100 Subject: [PATCH] stephanrauh/ngx-extended-pdf-viewer#1059 fix the "Window is not defined" bug --- src/core/annotation.js | 5 +++-- src/core/worker.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index 58cf2d85b4d9f..36ce9da4253c3 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -23,6 +23,7 @@ import { assert, escapeString, getModificationDate, + info, isAscii, isString, OPS, @@ -144,7 +145,7 @@ class AnnotationFactory { // #639 modified by ngx-extended-pdf- viewer case "Sig": if (self.showUnverifiedSignatures) { - Window['ngxConsole'].log( + info( "The PDF file contains a signature. Please take into account that it can't be verified yet. ngx-extended-pdf-viewer also displays forged signatures, so use this feature only if you're sure what you're doing." ); return new SignatureWidgetAnnotation(parameters); @@ -1295,7 +1296,7 @@ class WidgetAnnotation extends Annotation { // #171 modification start if (!self.showUnverifiedSignatures) { this.setFlags(AnnotationFlag.HIDDEN); - Window['ngxConsole'].log( + info( "The PDF file contains a signature. Please take into account that it can't be verified yet. By default, ngx-extended-pdf-viewer hides signatures until you configure it otherwise." ); } diff --git a/src/core/worker.js b/src/core/worker.js index bd76fc7f732ef..4332f1706c322 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -868,7 +868,7 @@ class WorkerMessageHandler { // #171 receive options from ngx-extended-pdf-viewer handler.on("showUnverifiedSignatures", function wphReady(data) { if (data) { - Window['ngxConsole'].log( + info( "showUnverifiedSignatures=" + data + ". This is an incompletely implemented feature. Signatures cannot be validated, so use it at own risk."