mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #6370 from castevinz/fix-getdocument-pdfBytes-check
api/getDocument: handle ArrayBuffer check for PDF binary data (byteLength)
This commit is contained in:
commit
b11bc727c2
1 changed files with 2 additions and 0 deletions
|
@ -295,6 +295,8 @@ PDFJS.getDocument = function getDocument(src,
|
|||
} else if (typeof pdfBytes === 'object' && pdfBytes !== null &&
|
||||
!isNaN(pdfBytes.length)) {
|
||||
params[key] = new Uint8Array(pdfBytes);
|
||||
} else if (isArrayBuffer(pdfBytes)) {
|
||||
params[key] = new Uint8Array(pdfBytes);
|
||||
} else {
|
||||
error('Invalid PDF binary data: either typed array, string or ' +
|
||||
'array-like object is expected in the data property.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue