Merge pull request #18785 from Snuffleupagus/transportFactory-init
Slightly re-factor the `transportFactory` initialization in `getDocument`
This commit is contained in:
commit
3902a148e2
@ -341,16 +341,17 @@ function getDocument(src = {}) {
|
|||||||
const transportFactory = {
|
const transportFactory = {
|
||||||
canvasFactory: new CanvasFactory({ ownerDocument, enableHWA }),
|
canvasFactory: new CanvasFactory({ ownerDocument, enableHWA }),
|
||||||
filterFactory: new FilterFactory({ docId, ownerDocument }),
|
filterFactory: new FilterFactory({ docId, ownerDocument }),
|
||||||
|
cMapReaderFactory:
|
||||||
|
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||||
|
useWorkerFetch
|
||||||
|
? null
|
||||||
|
: new CMapReaderFactory({ baseUrl: cMapUrl, isCompressed: cMapPacked }),
|
||||||
|
standardFontDataFactory:
|
||||||
|
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||||
|
useWorkerFetch
|
||||||
|
? null
|
||||||
|
: new StandardFontDataFactory({ baseUrl: standardFontDataUrl }),
|
||||||
};
|
};
|
||||||
if (!useWorkerFetch) {
|
|
||||||
transportFactory.cMapReaderFactory = new CMapReaderFactory({
|
|
||||||
baseUrl: cMapUrl,
|
|
||||||
isCompressed: cMapPacked,
|
|
||||||
});
|
|
||||||
transportFactory.standardFontDataFactory = new StandardFontDataFactory({
|
|
||||||
baseUrl: standardFontDataUrl,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!worker) {
|
if (!worker) {
|
||||||
const workerParams = {
|
const workerParams = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user