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

@ -211,6 +211,7 @@ var PDFViewerApplication = {
linkService: pdfLinkService,
downloadManager: downloadManager,
enhanceTextSelection: false,
renderInteractiveForms: false,
});
pdfRenderingQueue.setViewer(this.pdfViewer);
pdfLinkService.setViewer(this.pdfViewer);
@ -371,7 +372,10 @@ var PDFViewerApplication = {
PDFJS.externalLinkTarget = value;
}),
Preferences.get('renderInteractiveForms').then(function resolved(value) {
PDFJS.renderInteractiveForms = value;
// TODO: Like the `enhanceTextSelection` preference, move the
// initialization and fetching of `Preferences` to occur
// before the various viewer components are initialized.
self.pdfViewer.renderInteractiveForms = value;
}),
// TODO move more preferences and other async stuff here
]).catch(function (reason) { });