api/getDocument : handle ArrayBuffer check for PDF binary data (byteLength)
This commit is contained in:
parent
c56dc9a093
commit
0cd4cc4e80
@ -295,6 +295,8 @@ PDFJS.getDocument = function getDocument(src,
|
|||||||
} else if (typeof pdfBytes === 'object' && pdfBytes !== null &&
|
} else if (typeof pdfBytes === 'object' && pdfBytes !== null &&
|
||||||
!isNaN(pdfBytes.length)) {
|
!isNaN(pdfBytes.length)) {
|
||||||
params[key] = new Uint8Array(pdfBytes);
|
params[key] = new Uint8Array(pdfBytes);
|
||||||
|
} else if (isArrayBuffer(pdfBytes)) {
|
||||||
|
params[key] = new Uint8Array(pdfBytes);
|
||||||
} else {
|
} else {
|
||||||
error('Invalid PDF binary data: either typed array, string or ' +
|
error('Invalid PDF binary data: either typed array, string or ' +
|
||||||
'array-like object is expected in the data property.');
|
'array-like object is expected in the data property.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user