Group the evaluatorOptions on the main-thread, when sending "GetDocRequest"

Rather than sending all of these parameters individually and then grouping them together on the worker-thread, we can simply handle that in the API instead.
This commit is contained in:
Jonas Jenwald 2022-10-09 11:15:09 +02:00
parent 447915af9d
commit c84b717773
2 changed files with 14 additions and 24 deletions

View file

@ -517,19 +517,21 @@ async function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
rangeChunkSize: source.rangeChunkSize,
length: source.length,
},
maxImageSize: source.maxImageSize,
disableFontFace: source.disableFontFace,
docBaseUrl: source.docBaseUrl,
ignoreErrors: source.ignoreErrors,
isEvalSupported: source.isEvalSupported,
isOffscreenCanvasSupported: source.isOffscreenCanvasSupported,
fontExtraProperties: source.fontExtraProperties,
enableXfa: source.enableXfa,
useSystemFonts: source.useSystemFonts,
cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,
standardFontDataUrl: source.useWorkerFetch
? source.standardFontDataUrl
: null,
evaluatorOptions: {
maxImageSize: source.maxImageSize,
disableFontFace: source.disableFontFace,
ignoreErrors: source.ignoreErrors,
isEvalSupported: source.isEvalSupported,
isOffscreenCanvasSupported: source.isOffscreenCanvasSupported,
fontExtraProperties: source.fontExtraProperties,
useSystemFonts: source.useSystemFonts,
cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,
standardFontDataUrl: source.useWorkerFetch
? source.standardFontDataUrl
: null,
},
}
);