mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 23:28:06 +02:00
Fixes merge with 1849
This commit is contained in:
parent
eb863b2298
commit
f199a8b19e
1 changed files with 9 additions and 0 deletions
|
@ -20,6 +20,15 @@
|
|||
PDFJS.getDocument = function getDocument(source) {
|
||||
var workerInitializedPromise, workerReadyPromise, transport;
|
||||
|
||||
if (typeof source === 'string') {
|
||||
source = { url: source };
|
||||
} else if (isArrayBuffer(source)) {
|
||||
source = { data: source };
|
||||
} else if (typeof source !== 'object') {
|
||||
error('Invalid parameter in getDocument, need either Uint8Array, ' +
|
||||
'string or a parameter object');
|
||||
}
|
||||
|
||||
if (!source.url && !source.data)
|
||||
error('Invalid parameter array, need either .data or .url');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue