[api-minor] Add support for PageLabels in the API

This commit is contained in:
Jonas Jenwald 2015-12-25 21:57:08 +01:00
parent 8ad18959d7
commit 85cf90643f
7 changed files with 177 additions and 0 deletions

View file

@ -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);
},