From f34f96e2c1e404ddbf23610443c18d0da1d159bd Mon Sep 17 00:00:00 2001 From: Anton Kiselev Date: Mon, 25 Nov 2024 09:54:06 +0300 Subject: [PATCH 1/2] cleanup console.logs --- src/core/annotation.js | 1 - src/core/document.js | 3 --- src/core/worker.js | 1 - src/display/api.js | 1 - 4 files changed, 6 deletions(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index 78f38572a43f8..b2b089e2f607f 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -653,7 +653,6 @@ class Annotation { const isLocked = !!(this.flags & AnnotationFlag.LOCKED); const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS); - console.log(annotationGlobals.structTreeRoot); if (annotationGlobals.structTreeRoot) { let structParent = dict.get("StructParent"); structParent = diff --git a/src/core/document.js b/src/core/document.js index def86c026e3c9..60a8d2ec1bf30 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -755,12 +755,10 @@ class Page { intentPrint = !!(intent & RenderingIntentFlag.PRINT), intentOplist = !!(intent & RenderingIntentFlag.OPLIST); - console.log(annotations); for (const annotation of annotations) { // Get the annotation even if it's hidden because // JS can change its display. const isVisible = intentAny || (intentDisplay && annotation.viewable); - console.log(isVisible, intentPrint && annotation.printable, intentOplist); if (isVisible || (intentPrint && annotation.printable) || intentOplist) { annotationsData.push(annotation.data); } @@ -797,7 +795,6 @@ class Page { } await Promise.all(textContentPromises); - console.log("annotationsData", annotationsData); return annotationsData; } diff --git a/src/core/worker.js b/src/core/worker.js index 3ae7991267070..82eea4c3912bf 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -332,7 +332,6 @@ class WorkerMessageHandler { function setupDoc(data) { function onSuccess(doc) { - console.log(doc); ensureNotTerminated(); handler.send("GetDoc", { pdfInfo: doc }); } diff --git a/src/display/api.js b/src/display/api.js index 08f237abbf762..e008a75eee8c7 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1958,7 +1958,6 @@ class LoopbackPort { #deferred = Promise.resolve(); postMessage(obj, transfer) { - console.log(obj); const event = { data: structuredClone(obj, transfer ? { transfer } : null), }; From a7ee513dba0caa6254f0a809e64aa74f5282cf25 Mon Sep 17 00:00:00 2001 From: Anton Kiselev Date: Mon, 25 Nov 2024 09:55:01 +0300 Subject: [PATCH 2/2] fix error obj.has is not a function --- src/core/catalog.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/catalog.js b/src/core/catalog.js index ebce5c609f51c..82f711b2830fe 100644 --- a/src/core/catalog.js +++ b/src/core/catalog.js @@ -52,6 +52,7 @@ import { FileSpec } from "./file_spec.js"; import { GlobalImageCache } from "./image_utils.js"; import { MetadataParser } from "./metadata_parser.js"; import { StructTreeRoot } from "./struct_tree.js"; +import { FlateStream } from "./flate_stream.js"; function isValidExplicitDest(dest) { if (!Array.isArray(dest) || dest.length < 2) { @@ -1816,6 +1817,11 @@ class ExtendedCatalog extends Catalog { if (el instanceof Dict && el.has("Obj")) { const obj = el.get("Obj"); let type = null; + + if (obj instanceof FlateStream) { + return null; + } + if (obj.has("Type")) { type = obj.get("Type").name; }