fix: implement clone method for DrawingOptions and remove signature mode init

The clone method in DrawingOptions was previously unimplemented, now it properly creates a copy. Also removed unnecessary signature mode initialization in sign-pdf.ts as it's handled elsewhere.
This commit is contained in:
abdullahalam123
2025-11-15 10:30:37 +05:30
parent ae8bd3a004
commit bdb85b013c
2 changed files with 3 additions and 10 deletions

View File

@@ -21663,7 +21663,9 @@ class DrawingOptions {
this.updateProperties(options);
}
clone() {
unreachable("Not implemented");
const copy = new this.constructor();
copy.updateAll(this);
return copy;
}
}
class DrawingEditor extends AnnotationEditor {

View File

@@ -69,15 +69,6 @@ export async function setupSignTool() {
if (editorStampButton) {
editorStampButton.disabled = false;
}
// Ensure annotation editor is fully enabled; start in Signature mode
const pdfViewer = app.pdfViewer;
const AnnotationEditorType = viewerWindow.pdfjsLib?.AnnotationEditorType;
if (pdfViewer && AnnotationEditorType) {
pdfViewer.annotationEditorMode = {
mode: AnnotationEditorType.SIGNATURE,
};
}
}
} catch (e) {
console.error('Could not initialize base PDF.js viewer for signing:', e);