mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
[api-minor] Add support for PageLabels in the API
This commit is contained in:
parent
8ad18959d7
commit
85cf90643f
7 changed files with 177 additions and 0 deletions
|
@ -690,6 +690,16 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
|
|||
getDestination: function PDFDocumentProxy_getDestination(id) {
|
||||
return this.transport.getDestination(id);
|
||||
},
|
||||
/**
|
||||
* @return {Promise} A promise that is resolved with: an Array containing
|
||||
* the pageLabels that correspond to the pageIndexes; or null, when no
|
||||
* pageLabels are present in the PDF file.
|
||||
* NOTE: If the pageLabels are all identical to standard page numbering,
|
||||
* i.e. [1, 2, 3, ...], the promise is resolved with an empty Array.
|
||||
*/
|
||||
getPageLabels: function PDFDocumentProxy_getPageLabels() {
|
||||
return this.transport.getPageLabels();
|
||||
},
|
||||
/**
|
||||
* @return {Promise} A promise that is resolved with a lookup table for
|
||||
* mapping named attachments to their content.
|
||||
|
@ -1804,6 +1814,10 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||
return this.messageHandler.sendWithPromise('GetDestination', { id: id });
|
||||
},
|
||||
|
||||
getPageLabels: function WorkerTransport_getPageLabels() {
|
||||
return this.messageHandler.sendWithPromise('GetPageLabels', null);
|
||||
},
|
||||
|
||||
getAttachments: function WorkerTransport_getAttachments() {
|
||||
return this.messageHandler.sendWithPromise('GetAttachments', null);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue