You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using pdfjs dist version 4.6.82 build '9b541910f' in a Drupal 10 CMS to display PDFs in a non-printable manner.
The viewer.html is displayed but I am facing this error of:
Uncaught (in promise) TypeError: editorFreeHighlightThickness is null annotation_editor_params.js:87:4
#bindListeners annotation_editor_params.js:87
AnnotationEditorParams annotation_editor_params.js:39
_initializeViewerComponents app.js:527
initialize app.js:253
run app.js:675
webViewerLoad viewer.js:254
viewer.js:265
So the pdf itself is NOT displayed.
`/* Copyright 2022 Mozilla Foundation
*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
This discussion was converted from issue #18836 on October 02, 2024 16:39.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Attach (recommended) or Link to PDF file
I am using pdfjs dist version 4.6.82 build '9b541910f' in a Drupal 10 CMS to display PDFs in a non-printable manner.
The viewer.html is displayed but I am facing this error of:
Uncaught (in promise) TypeError: editorFreeHighlightThickness is null annotation_editor_params.js:87:4
#bindListeners annotation_editor_params.js:87
AnnotationEditorParams annotation_editor_params.js:39
_initializeViewerComponents app.js:527
initialize app.js:253
run app.js:675
webViewerLoad viewer.js:254
viewer.js:265
So the pdf itself is NOT displayed.
`/* Copyright 2022 Mozilla Foundation
*
*/
/** @typedef {import("./event_utils.js").EventBus} EventBus */
import { AnnotationEditorParamsType } from "pdfjs-lib";
/**
*/
class AnnotationEditorParams {
/**
*/
constructor(options, eventBus) {
this.eventBus = eventBus;
this.#bindListeners(options);
}
/**
*/
#bindListeners({
editorFreeTextFontSize,
editorFreeTextColor,
editorInkColor,
editorInkThickness,
editorInkOpacity,
editorStampAddImage,
editorFreeHighlightThickness,
editorHighlightShowAll,
}) {
const dispatchEvent = (typeStr, value) => {
this.eventBus.dispatch("switchannotationeditorparams", {
source: this,
type: AnnotationEditorParamsType[typeStr],
value,
});
};
editorFreeTextFontSize.addEventListener("input", function () {
dispatchEvent("FREETEXT_SIZE", this.valueAsNumber);
});
editorFreeTextColor.addEventListener("input", function () {
dispatchEvent("FREETEXT_COLOR", this.value);
});
editorInkColor.addEventListener("input", function () {
dispatchEvent("INK_COLOR", this.value);
});
editorInkThickness.addEventListener("input", function () {
dispatchEvent("INK_THICKNESS", this.valueAsNumber);
});
editorInkOpacity.addEventListener("input", function () {
dispatchEvent("INK_OPACITY", this.valueAsNumber);
});
editorStampAddImage.addEventListener("click", () => {
this.eventBus.dispatch("reporttelemetry", {
source: this,
details: {
type: "editing",
data: { action: "pdfjs.image.add_image_click" },
},
});
dispatchEvent("CREATE");
});
editorFreeHighlightThickness.addEventListener("input", function () {
dispatchEvent("HIGHLIGHT_THICKNESS", this.valueAsNumber);
});
editorHighlightShowAll.addEventListener("click", function () {
const checked = this.getAttribute("aria-pressed") === "true";
this.setAttribute("aria-pressed", !checked);
dispatchEvent("HIGHLIGHT_SHOW_ALL", !checked);
});
}
}
export { AnnotationEditorParams };`
Web browser and its version
firefox 130.0.1
Operating system and its version
Windows 11
PDF.js version
4.6.82
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
implementing the pfdjs dist web and build folders and using the corresponding viewer.mjs
What is the expected behavior?
to see the pdf
What went wrong?
the above described error occured in annotation_editor_params.js
Link to a viewer
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions