Move various viewer components options from PDFJS/PDFViewerApplication.viewerPrefs and into AppOptions instead

This commit is contained in:
Jonas Jenwald 2018-02-17 15:08:28 +01:00
parent 09da99b8a0
commit 81c550903f
6 changed files with 155 additions and 124 deletions

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { createPromiseCapability, PDFJS } from 'pdfjs-lib';
import { createPromiseCapability } from 'pdfjs-lib';
const CSS_UNITS = 96.0 / 72.0;
const DEFAULT_SCALE_VALUE = 'auto';
@ -71,39 +71,6 @@ let NullL10n = {
},
};
/**
* Enables CSS only zooming.
* @var {boolean}
*/
PDFJS.useOnlyCssZoom = (PDFJS.useOnlyCssZoom === undefined ?
false : PDFJS.useOnlyCssZoom);
/**
* The maximum supported canvas size in total pixels e.g. width * height.
* The default value is 4096 * 4096. Use -1 for no limit.
* @var {number}
*/
PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
16777216 : PDFJS.maxCanvasPixels);
/**
* Disables saving of the last position of the viewed PDF.
* @var {boolean}
*/
PDFJS.disableHistory = (PDFJS.disableHistory === undefined ?
false : PDFJS.disableHistory);
if (typeof PDFJSDev === 'undefined' ||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
/**
* Interface locale settings.
* @var {string}
*/
PDFJS.locale =
(PDFJS.locale === undefined && typeof navigator !== 'undefined' ?
navigator.language : PDFJS.locale) || 'en-US';
}
/**
* Returns scale factor for the canvas. It makes sense for the HiDPI displays.
* @return {Object} The object with horizontal (sx) and vertical (sy)