mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Add support for saving forms
This commit is contained in:
parent
3380f2a7fc
commit
1a6816ba98
16 changed files with 1060 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue