From 0cd4cc4e80c4c90b2ad1af6c55b65ca504d3d8d6 Mon Sep 17 00:00:00 2001 From: Vincent Castelain <vincent.castelain@dbit.lu> Date: Wed, 19 Aug 2015 17:54:41 +0200 Subject: [PATCH] api/getDocument : handle ArrayBuffer check for PDF binary data (byteLength) --- src/display/api.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/display/api.js b/src/display/api.js index 944d3fe69..5d7f8093b 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -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.');