Skip to content

Commit

Permalink
Fix error when using custom CMapReaderFactory and worker
Browse files Browse the repository at this point in the history
  • Loading branch information
ghetolay committed Jun 23, 2017
1 parent 2f2e539 commit 7f79e12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/display/api.js
Original file line number Diff line number Diff line change
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

0 comments on commit 7f79e12

Please sign in to comment.