mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Add PageLabels to PDFPageView
and PDFThumbnailView
This commit is contained in:
parent
f461fd64aa
commit
efb9619e53
4 changed files with 55 additions and 2 deletions
|
@ -78,6 +78,7 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||
|
||||
this.id = id;
|
||||
this.renderingId = 'page' + id;
|
||||
this.pageLabel = null;
|
||||
|
||||
this.rotation = 0;
|
||||
this.scale = scale || DEFAULT_SCALE;
|
||||
|
@ -554,6 +555,19 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||
}
|
||||
return promise;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string|null} label
|
||||
*/
|
||||
setPageLabel: function PDFView_setPageLabel(label) {
|
||||
this.pageLabel = (typeof label === 'string' ? label : null);
|
||||
|
||||
if (this.pageLabel !== null) {
|
||||
this.div.setAttribute('data-page-label', this.pageLabel);
|
||||
} else {
|
||||
this.div.removeAttribute('data-page-label');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return PDFPageView;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue