Add support for saving forms

This commit is contained in:
Calixte Denizet 2020-08-03 19:44:04 +02:00 committed by calixteman
parent 3380f2a7fc
commit 1a6816ba98
16 changed files with 1060 additions and 8 deletions

View file

@ -867,6 +867,16 @@ class PDFDocumentProxy {
get loadingTask() {
return this._transport.loadingTask;
}
/**
* @param {AnnotationStorage} annotationStorage - Storage for annotation
* data in forms.
* @returns {Promise<Uint8Array>} A promise that is resolved with a
* {Uint8Array} containing the full data of the saved document.
*/
saveDocument(annotationStorage) {
return this._transport.saveDocument(annotationStorage);
}
}
/**
@ -2520,6 +2530,15 @@ class WorkerTransport {
});
}
saveDocument(annotationStorage) {
return this.messageHandler.sendWithPromise("SaveDocument", {
numPages: this._numPages,
annotationStorage:
(annotationStorage && annotationStorage.getAll()) || null,
filename: this._fullReader.filename,
});
}
getDestinations() {
return this.messageHandler.sendWithPromise("GetDestinations", null);
}