Add PageLabels to PDFPageView and PDFThumbnailView

This commit is contained in:
Jonas Jenwald 2016-01-27 14:27:01 +01:00
parent f461fd64aa
commit efb9619e53
4 changed files with 55 additions and 2 deletions

View file

@ -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;