1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Merge upstream. Use new l10n.

This commit is contained in:
Brendan Dahl 2012-05-15 10:33:01 -07:00
commit 080c3e79fc
15 changed files with 374 additions and 61 deletions

View file

@ -8,10 +8,12 @@
* 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.
* @param {Object} headers An object containing the http headers like this:
* { Authorization: "BASIC XXX" }.
* @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 +31,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);