From 353a43cb46e34ee82b3458df1138952282973aec Mon Sep 17 00:00:00 2001 From: asraniel Date: Sun, 6 May 2012 21:24:42 +0200 Subject: [PATCH] Add first API change, not working yet --- src/api.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api.js b/src/api.js index bbab680ce..b3415c08e 100644 --- a/src/api.js +++ b/src/api.js @@ -8,10 +8,10 @@ * e.g. No cross domain requests without CORS. * * @param {string|TypedAray} source Either a url to a PDF is located or a - * typed array already populated with data. + * typed array (Uint8Array) already populated with data. * @return {Promise} A promise that is resolved with {PDFDocumentProxy} object. */ -PDFJS.getDocument = function getDocument(source) { +PDFJS.getDocument = function getDocument(source, headers) { var promise = new PDFJS.Promise(); var transport = new WorkerTransport(promise); if (typeof source === 'string') { @@ -29,7 +29,8 @@ PDFJS.getDocument = function getDocument(source) { error: function getPDFError(e) { promise.reject('Unexpected server response of ' + e.target.status + '.'); - } + }, + headers: headers }, function getPDFLoad(data) { transport.sendData(data);