Merge pull request #10738 from Snuffleupagus/ViewerPreferences-api

[api-minor] Add support for ViewerPreferences in the API (issue 10736)
This commit is contained in:
Tim van der Meij 2019-04-20 18:39:32 +02:00 committed by GitHub
commit 762c58e0fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 176 additions and 7 deletions

View file

@ -674,6 +674,14 @@ class PDFDocumentProxy {
return this._transport.getPageMode();
}
/**
* @return {Promise} A promise that is resolved with an {Object} containing
* the viewer preferences.
*/
getViewerPreferences() {
return this._transport.getViewerPreferences();
}
/**
* @return {Promise} A promise that is resolved with an {Array} containing the
* destination, or `null` when no open action is present in the PDF file.
@ -2247,8 +2255,12 @@ class WorkerTransport {
return this.messageHandler.sendWithPromise('GetPageMode', null);
}
getViewerPreferences() {
return this.messageHandler.sendWithPromise('GetViewerPreferences', null);
}
getOpenActionDestination() {
return this.messageHandler.sendWithPromise('getOpenActionDestination',
return this.messageHandler.sendWithPromise('GetOpenActionDestination',
null);
}