mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Add first API change, not working yet
This commit is contained in:
parent
e9128e2e35
commit
353a43cb46
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue