1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 07:38:07 +02:00

Move the imageResourcesPath option to a BaseViewer/PDFPageView/AnnotationLayerBuilder option

This removes the `PDFJS.imageResourcesPath` dependency from the viewer components and the test-suite, but please note that as a *temporary* solution the default viewer still uses it.
This commit is contained in:
Jonas Jenwald 2018-02-13 13:17:11 +01:00
parent fdf99c6af5
commit c45c394364
9 changed files with 42 additions and 24 deletions

View file

@ -18,6 +18,7 @@
var WAITING_TIME = 100; // ms
var PDF_TO_CSS_UNITS = 96.0 / 72.0;
const IMAGE_RESOURCES_PATH = '/web/images/';
/**
* @class
@ -164,6 +165,7 @@ var rasterizeAnnotationLayer = (function rasterizeAnnotationLayerClosure() {
}
function rasterizeAnnotationLayer(ctx, viewport, annotations, page,
imageResourcesPath,
renderInteractiveForms) {
return new Promise(function (resolve) {
// Building SVG with size of the viewport.
@ -194,6 +196,7 @@ var rasterizeAnnotationLayer = (function rasterizeAnnotationLayerClosure() {
annotations,
page,
linkService: new PDFJS.SimpleLinkService(),
imageResourcesPath,
renderInteractiveForms,
};
PDFJS.AnnotationLayer.render(parameters);
@ -252,7 +255,6 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
PDFJS.cMapPacked = true;
PDFJS.cMapUrl = '../external/bcmaps/';
PDFJS.enableStats = true;
PDFJS.imageResourcesPath = '/web/images/';
// Set the passed options
this.inflight = options.inflight;
@ -506,7 +508,9 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
function(annotations) {
return rasterizeAnnotationLayer(annotationLayerContext,
viewport, annotations,
page, renderForms);
page,
IMAGE_RESOURCES_PATH,
renderForms);
});
} else {
annotationLayerCanvas = null;