mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Implement a permissions API
This commit is contained in:
parent
4874e9ace0
commit
959ed3705b
9 changed files with 137 additions and 4 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue