Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when using custom CMapReaderFactory #8567

Merged
merged 1 commit into from Jun 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/display/api.js
Expand Up @@ -211,6 +211,8 @@ function getDocument(src, pdfDataRangeTransport,
var params = {};
var rangeTransport = null;
var worker = null;
var CMapReaderFactory = DOMCMapReaderFactory;

for (var key in source) {
if (key === 'url' && typeof window !== 'undefined') {
// The full path is required in the 'url' field.
Expand All @@ -237,13 +239,15 @@ function getDocument(src, pdfDataRangeTransport,
'array-like object is expected in the data property.');
}
continue;
} else if (key === 'CMapReaderFactory') {
CMapReaderFactory = source[key];
continue;
}
params[key] = source[key];
}

params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE;
params.ignoreErrors = params.stopAtErrors !== true;
var CMapReaderFactory = params.CMapReaderFactory || DOMCMapReaderFactory;

if (params.disableNativeImageDecoder !== undefined) {
deprecated('parameter disableNativeImageDecoder, ' +
Expand Down