mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #18785 from Snuffleupagus/transportFactory-init
Slightly re-factor the `transportFactory` initialization in `getDocument`
This commit is contained in:
commit
3902a148e2
1 changed files with 10 additions and 9 deletions
|
@ -341,16 +341,17 @@ function getDocument(src = {}) {
|
|||
const transportFactory = {
|
||||
canvasFactory: new CanvasFactory({ ownerDocument, enableHWA }),
|
||||
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) {
|
||||
const workerParams = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue