fix(pdfjs-annotation-viewer): initialize konvaClientRect dimensions and add HASH_PARAMS implementation

Updated the pdfjs-annotation-extension-testdata.json to set default dimensions for konvaClientRect to zero. Added a HASH_PARAMS implementation in viewer.html to handle hash parsing, ensuring compatibility with the pdfjs-annotation-extension bundle and preventing runtime errors.
This commit is contained in:
abdullahalam123
2025-11-15 20:25:30 +05:30
parent 95bfda0e99
commit 9ee8225114
4 changed files with 27 additions and 11 deletions

View File

@@ -91,11 +91,6 @@ function setupAnnotationViewer(iframe: HTMLIFrameElement) {
stampBtn.disabled = false
}
const AnnotationEditorType = win.pdfjsLib?.AnnotationEditorType
if (app?.pdfViewer && AnnotationEditorType?.STAMP != null) {
app.pdfViewer.annotationEditorMode = AnnotationEditorType.STAMP
}
const root = doc.querySelector('.PdfjsAnnotationExtension') as HTMLElement | null
if (root) {
root.classList.add('PdfjsAnnotationExtension_Comment_hidden')