Interactive forms: remove global PDFJS usage

This commit is contained in:
Tim van der Meij 2016-09-17 19:44:25 +02:00
parent f062695d62
commit 2da2c45889
6 changed files with 30 additions and 14 deletions

View file

@ -78,6 +78,8 @@ var DEFAULT_CACHE_SIZE = 10;
* around the pages. The default is false.
* @property {boolean} enhanceTextSelection - (optional) Enables the improved
* text selection behaviour. The default is `false`.
* @property {boolean} renderInteractiveForms - (optional) Enables rendering of
* interactive form elements. The default is `false`.
*/
/**
@ -130,6 +132,7 @@ var PDFViewer = (function pdfViewer() {
this.downloadManager = options.downloadManager || null;
this.removePageBorders = options.removePageBorders || false;
this.enhanceTextSelection = options.enhanceTextSelection || false;
this.renderInteractiveForms = options.renderInteractiveForms || false;
this.defaultRenderingQueue = !options.renderingQueue;
if (this.defaultRenderingQueue) {
@ -357,6 +360,7 @@ var PDFViewer = (function pdfViewer() {
textLayerFactory: textLayerFactory,
annotationLayerFactory: this,
enhanceTextSelection: this.enhanceTextSelection,
renderInteractiveForms: this.renderInteractiveForms,
});
bindOnAfterAndBeforeDraw(pageView);
this._pages.push(pageView);
@ -856,12 +860,15 @@ var PDFViewer = (function pdfViewer() {
/**
* @param {HTMLDivElement} pageDiv
* @param {PDFPage} pdfPage
* @param {boolean} renderInteractiveForms
* @returns {AnnotationLayerBuilder}
*/
createAnnotationLayerBuilder: function (pageDiv, pdfPage) {
createAnnotationLayerBuilder: function (pageDiv, pdfPage,
renderInteractiveForms) {
return new AnnotationLayerBuilder({
pageDiv: pageDiv,
pdfPage: pdfPage,
renderInteractiveForms: renderInteractiveForms,
linkService: this.linkService,
downloadManager: this.downloadManager
});