2025-12-29 02:00:59 +02:00

21 lines
669 B
JavaScript

document.addEventListener("webviewerloaded", async () => {
const app = PDFViewerApplication;
await app.initializedPromise;
app.eventBus.on("documentloaded", () => {
const storage = app.pdfDocument.annotationStorage;
storage.onSetModified = (data) => {
console.log("Annotations modified: ", all);
storage.resetModified();
};
const oldSetValue = storage.setValue;
storage.setValue = (key, value) => {
console.log("Setting annotation: ", key, value);
oldSetValue.call(storage, key, value);
}
});
});
console.log("Custom script loaded");