mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[api-minor] Change getPageLabels
to always return the pageLabels, even if they are identical to standard page numbering
This commit is contained in:
parent
1f2910b2a2
commit
1140a34f5c
3 changed files with 17 additions and 17 deletions
|
@ -343,14 +343,7 @@ var Catalog = (function CatalogClosure() {
|
|||
currentLabel = '';
|
||||
currentIndex++;
|
||||
}
|
||||
|
||||
// Ignore PageLabels if they correspond to standard page numbering.
|
||||
for (i = 0, ii = this.numPages; i < ii; i++) {
|
||||
if (pageLabels[i] !== (i + 1).toString()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (i === ii ? [] : pageLabels);
|
||||
return pageLabels;
|
||||
},
|
||||
|
||||
get attachments() {
|
||||
|
|
|
@ -691,11 +691,9 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
|
|||
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.
|
||||
* @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.
|
||||
*/
|
||||
getPageLabels: function PDFDocumentProxy_getPageLabels() {
|
||||
return this.transport.getPageLabels();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue