Mein Anwendungsfall besteht jedoch darin, Anmerkungen zu erstellen und die Anmerkungen als zu exportieren JSON, dann möchte ich es beim Rendern der PDF-Datei zurückimportieren.
Ich habe es versucht
Code: Select all
// Gets all the annotation data as a map that can be exported as JSON
annotations = pdfDocument.annotationStorage.serializable();
// Tried loading the Annotations by setting it after the new render
pdfjsLib.getDocument({
data: pdfData,
cMapUrl: CMAP_URL,
cMapPacked: CMAP_PACKED,
enableXfa: true,
}).promise.then((_pdfDocument) => {
for (let [key, value] of annotations) {
pdfDocument.annotationStorage.setValue(key,value);
}
})
Gibt es in der PDFViewer-Klasse eine Methode zum Importieren der serialisierten Anmerkungen?
Ihr kleiner Beitrag wird sehr geschätzt. Vielen Dank, dass Sie meine Frage gelesen haben.