Implement a permissions API

This commit is contained in:
Tim van der Meij 2018-08-26 21:37:05 +02:00
parent 4874e9ace0
commit 959ed3705b
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
9 changed files with 137 additions and 4 deletions

View file

@ -691,6 +691,15 @@ class PDFDocumentProxy {
return this._transport.getOutline();
}
/**
* @return {Promise} A promise that is resolved with an {Array} that contains
* the permission flags for the PDF document, or `null` when
* no permissions are present in the PDF file.
*/
getPermissions() {
return this._transport.getPermissions();
}
/**
* @return {Promise} A promise that is resolved with an {Object} that has
* `info` and `metadata` properties. `info` is an {Object} filled with
@ -2141,6 +2150,10 @@ class WorkerTransport {
return this.messageHandler.sendWithPromise('GetOutline', null);
}
getPermissions() {
return this.messageHandler.sendWithPromise('GetPermissions', null);
}
getMetadata() {
return this.messageHandler.sendWithPromise('GetMetadata', null).
then((results) => {