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:
parent
447915af9d
commit
c84b717773
@ -405,19 +405,7 @@ class WorkerMessageHandler {
|
|||||||
|
|
||||||
ensureNotTerminated();
|
ensureNotTerminated();
|
||||||
|
|
||||||
const evaluatorOptions = {
|
getPdfManager(data, data.evaluatorOptions, data.enableXfa)
|
||||||
maxImageSize: data.maxImageSize,
|
|
||||||
disableFontFace: data.disableFontFace,
|
|
||||||
ignoreErrors: data.ignoreErrors,
|
|
||||||
isEvalSupported: data.isEvalSupported,
|
|
||||||
isOffscreenCanvasSupported: data.isOffscreenCanvasSupported,
|
|
||||||
fontExtraProperties: data.fontExtraProperties,
|
|
||||||
useSystemFonts: data.useSystemFonts,
|
|
||||||
cMapUrl: data.cMapUrl,
|
|
||||||
standardFontDataUrl: data.standardFontDataUrl,
|
|
||||||
};
|
|
||||||
|
|
||||||
getPdfManager(data, evaluatorOptions, data.enableXfa)
|
|
||||||
.then(function (newPdfManager) {
|
.then(function (newPdfManager) {
|
||||||
if (terminated) {
|
if (terminated) {
|
||||||
// We were in a process of setting up the manager, but it got
|
// We were in a process of setting up the manager, but it got
|
||||||
|
@ -517,19 +517,21 @@ async function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
|||||||
rangeChunkSize: source.rangeChunkSize,
|
rangeChunkSize: source.rangeChunkSize,
|
||||||
length: source.length,
|
length: source.length,
|
||||||
},
|
},
|
||||||
maxImageSize: source.maxImageSize,
|
|
||||||
disableFontFace: source.disableFontFace,
|
|
||||||
docBaseUrl: source.docBaseUrl,
|
docBaseUrl: source.docBaseUrl,
|
||||||
ignoreErrors: source.ignoreErrors,
|
|
||||||
isEvalSupported: source.isEvalSupported,
|
|
||||||
isOffscreenCanvasSupported: source.isOffscreenCanvasSupported,
|
|
||||||
fontExtraProperties: source.fontExtraProperties,
|
|
||||||
enableXfa: source.enableXfa,
|
enableXfa: source.enableXfa,
|
||||||
useSystemFonts: source.useSystemFonts,
|
evaluatorOptions: {
|
||||||
cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,
|
maxImageSize: source.maxImageSize,
|
||||||
standardFontDataUrl: source.useWorkerFetch
|
disableFontFace: source.disableFontFace,
|
||||||
? source.standardFontDataUrl
|
ignoreErrors: source.ignoreErrors,
|
||||||
: null,
|
isEvalSupported: source.isEvalSupported,
|
||||||
|
isOffscreenCanvasSupported: source.isOffscreenCanvasSupported,
|
||||||
|
fontExtraProperties: source.fontExtraProperties,
|
||||||
|
useSystemFonts: source.useSystemFonts,
|
||||||
|
cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,
|
||||||
|
standardFontDataUrl: source.useWorkerFetch
|
||||||
|
? source.standardFontDataUrl
|
||||||
|
: null,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user