|
@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
|
}
|
|
}
|
|
|
|
|
|
-PDFJS.version = '1.0.774';
|
|
|
|
-PDFJS.build = 'e096669';
|
|
|
|
|
|
+PDFJS.version = '1.0.780';
|
|
|
|
+PDFJS.build = 'ffb613b';
|
|
|
|
|
|
(function pdfjsWrapper() {
|
|
(function pdfjsWrapper() {
|
|
// Use strict in our context only - users might not want it
|
|
// Use strict in our context only - users might not want it
|
|
@@ -373,6 +373,7 @@ var PasswordException = (function PasswordExceptionClosure() {
|
|
|
|
|
|
return PasswordException;
|
|
return PasswordException;
|
|
})();
|
|
})();
|
|
|
|
+PDFJS.PasswordException = PasswordException;
|
|
|
|
|
|
var UnknownErrorException = (function UnknownErrorExceptionClosure() {
|
|
var UnknownErrorException = (function UnknownErrorExceptionClosure() {
|
|
function UnknownErrorException(msg, details) {
|
|
function UnknownErrorException(msg, details) {
|
|
@@ -386,6 +387,7 @@ var UnknownErrorException = (function UnknownErrorExceptionClosure() {
|
|
|
|
|
|
return UnknownErrorException;
|
|
return UnknownErrorException;
|
|
})();
|
|
})();
|
|
|
|
+PDFJS.UnknownErrorException = UnknownErrorException;
|
|
|
|
|
|
var InvalidPDFException = (function InvalidPDFExceptionClosure() {
|
|
var InvalidPDFException = (function InvalidPDFExceptionClosure() {
|
|
function InvalidPDFException(msg) {
|
|
function InvalidPDFException(msg) {
|
|
@@ -398,6 +400,7 @@ var InvalidPDFException = (function InvalidPDFExceptionClosure() {
|
|
|
|
|
|
return InvalidPDFException;
|
|
return InvalidPDFException;
|
|
})();
|
|
})();
|
|
|
|
+PDFJS.InvalidPDFException = InvalidPDFException;
|
|
|
|
|
|
var MissingPDFException = (function MissingPDFExceptionClosure() {
|
|
var MissingPDFException = (function MissingPDFExceptionClosure() {
|
|
function MissingPDFException(msg) {
|
|
function MissingPDFException(msg) {
|
|
@@ -410,6 +413,22 @@ var MissingPDFException = (function MissingPDFExceptionClosure() {
|
|
|
|
|
|
return MissingPDFException;
|
|
return MissingPDFException;
|
|
})();
|
|
})();
|
|
|
|
+PDFJS.MissingPDFException = MissingPDFException;
|
|
|
|
+
|
|
|
|
+var UnexpectedResponseException =
|
|
|
|
+ (function UnexpectedResponseExceptionClosure() {
|
|
|
|
+ function UnexpectedResponseException(msg, status) {
|
|
|
|
+ this.name = 'UnexpectedResponseException';
|
|
|
|
+ this.message = msg;
|
|
|
|
+ this.status = status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ UnexpectedResponseException.prototype = new Error();
|
|
|
|
+ UnexpectedResponseException.constructor = UnexpectedResponseException;
|
|
|
|
+
|
|
|
|
+ return UnexpectedResponseException;
|
|
|
|
+})();
|
|
|
|
+PDFJS.UnexpectedResponseException = UnexpectedResponseException;
|
|
|
|
|
|
var NotImplementedException = (function NotImplementedExceptionClosure() {
|
|
var NotImplementedException = (function NotImplementedExceptionClosure() {
|
|
function NotImplementedException(msg) {
|
|
function NotImplementedException(msg) {
|
|
@@ -2380,36 +2399,46 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|
this.workerReadyCapability.resolve(pdfDocument);
|
|
this.workerReadyCapability.resolve(pdfDocument);
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
- messageHandler.on('NeedPassword', function transportPassword(data) {
|
|
|
|
|
|
+ messageHandler.on('NeedPassword',
|
|
|
|
+ function transportNeedPassword(exception) {
|
|
if (this.passwordCallback) {
|
|
if (this.passwordCallback) {
|
|
return this.passwordCallback(updatePassword,
|
|
return this.passwordCallback(updatePassword,
|
|
PasswordResponses.NEED_PASSWORD);
|
|
PasswordResponses.NEED_PASSWORD);
|
|
}
|
|
}
|
|
- this.workerReadyCapability.reject(data.exception.message,
|
|
|
|
- data.exception);
|
|
|
|
|
|
+ this.workerReadyCapability.reject(
|
|
|
|
+ new PasswordException(exception.message, exception.code));
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
- messageHandler.on('IncorrectPassword', function transportBadPass(data) {
|
|
|
|
|
|
+ messageHandler.on('IncorrectPassword',
|
|
|
|
+ function transportIncorrectPassword(exception) {
|
|
if (this.passwordCallback) {
|
|
if (this.passwordCallback) {
|
|
return this.passwordCallback(updatePassword,
|
|
return this.passwordCallback(updatePassword,
|
|
PasswordResponses.INCORRECT_PASSWORD);
|
|
PasswordResponses.INCORRECT_PASSWORD);
|
|
}
|
|
}
|
|
- this.workerReadyCapability.reject(data.exception.message,
|
|
|
|
- data.exception);
|
|
|
|
|
|
+ this.workerReadyCapability.reject(
|
|
|
|
+ new PasswordException(exception.message, exception.code));
|
|
|
|
+ }, this);
|
|
|
|
+
|
|
|
|
+ messageHandler.on('InvalidPDF', function transportInvalidPDF(exception) {
|
|
|
|
+ this.workerReadyCapability.reject(
|
|
|
|
+ new InvalidPDFException(exception.message));
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
- messageHandler.on('InvalidPDF', function transportInvalidPDF(data) {
|
|
|
|
- this.workerReadyCapability.reject(data.exception.name, data.exception);
|
|
|
|
|
|
+ messageHandler.on('MissingPDF', function transportMissingPDF(exception) {
|
|
|
|
+ this.workerReadyCapability.reject(
|
|
|
|
+ new MissingPDFException(exception.message));
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
- messageHandler.on('MissingPDF', function transportMissingPDF(data) {
|
|
|
|
- this.workerReadyCapability.reject(data.exception.message,
|
|
|
|
- data.exception);
|
|
|
|
|
|
+ messageHandler.on('UnexpectedResponse',
|
|
|
|
+ function transportUnexpectedResponse(exception) {
|
|
|
|
+ this.workerReadyCapability.reject(
|
|
|
|
+ new UnexpectedResponseException(exception.message, exception.status));
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
- messageHandler.on('UnknownError', function transportUnknownError(data) {
|
|
|
|
- this.workerReadyCapability.reject(data.exception.message,
|
|
|
|
- data.exception);
|
|
|
|
|
|
+ messageHandler.on('UnknownError',
|
|
|
|
+ function transportUnknownError(exception) {
|
|
|
|
+ this.workerReadyCapability.reject(
|
|
|
|
+ new UnknownErrorException(exception.message, exception.details));
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
messageHandler.on('DataLoaded', function transportPage(data) {
|
|
messageHandler.on('DataLoaded', function transportPage(data) {
|
|
@@ -2505,10 +2534,6 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|
}
|
|
}
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
- messageHandler.on('DocError', function transportDocError(data) {
|
|
|
|
- this.workerReadyCapability.reject(data);
|
|
|
|
- }, this);
|
|
|
|
-
|
|
|
|
messageHandler.on('PageError', function transportError(data) {
|
|
messageHandler.on('PageError', function transportError(data) {
|
|
var page = this.pageCache[data.pageNum - 1];
|
|
var page = this.pageCache[data.pageNum - 1];
|
|
var intentState = page.intentStates[data.intent];
|
|
var intentState = page.intentStates[data.intent];
|
|
@@ -39422,14 +39447,16 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {
|
|
},
|
|
},
|
|
|
|
|
|
onError: function onError(status) {
|
|
onError: function onError(status) {
|
|
|
|
+ var exception;
|
|
if (status === 404) {
|
|
if (status === 404) {
|
|
- var exception = new MissingPDFException('Missing PDF "' +
|
|
|
|
- source.url + '".');
|
|
|
|
- handler.send('MissingPDF', { exception: exception });
|
|
|
|
|
|
+ exception = new MissingPDFException('Missing PDF "' +
|
|
|
|
+ source.url + '".');
|
|
|
|
+ handler.send('MissingPDF', exception);
|
|
} else {
|
|
} else {
|
|
- handler.send('DocError', 'Unexpected server response (' +
|
|
|
|
- status + ') while retrieving PDF "' +
|
|
|
|
- source.url + '".');
|
|
|
|
|
|
+ exception = new UnexpectedResponseException(
|
|
|
|
+ 'Unexpected server response (' + status +
|
|
|
|
+ ') while retrieving PDF "' + source.url + '".', status);
|
|
|
|
+ handler.send('UnexpectedResponse', exception);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -39481,26 +39508,19 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {
|
|
var onFailure = function(e) {
|
|
var onFailure = function(e) {
|
|
if (e instanceof PasswordException) {
|
|
if (e instanceof PasswordException) {
|
|
if (e.code === PasswordResponses.NEED_PASSWORD) {
|
|
if (e.code === PasswordResponses.NEED_PASSWORD) {
|
|
- handler.send('NeedPassword', {
|
|
|
|
- exception: e
|
|
|
|
- });
|
|
|
|
|
|
+ handler.send('NeedPassword', e);
|
|
} else if (e.code === PasswordResponses.INCORRECT_PASSWORD) {
|
|
} else if (e.code === PasswordResponses.INCORRECT_PASSWORD) {
|
|
- handler.send('IncorrectPassword', {
|
|
|
|
- exception: e
|
|
|
|
- });
|
|
|
|
|
|
+ handler.send('IncorrectPassword', e);
|
|
}
|
|
}
|
|
} else if (e instanceof InvalidPDFException) {
|
|
} else if (e instanceof InvalidPDFException) {
|
|
- handler.send('InvalidPDF', {
|
|
|
|
- exception: e
|
|
|
|
- });
|
|
|
|
|
|
+ handler.send('InvalidPDF', e);
|
|
} else if (e instanceof MissingPDFException) {
|
|
} else if (e instanceof MissingPDFException) {
|
|
- handler.send('MissingPDF', {
|
|
|
|
- exception: e
|
|
|
|
- });
|
|
|
|
|
|
+ handler.send('MissingPDF', e);
|
|
|
|
+ } else if (e instanceof UnexpectedResponseException) {
|
|
|
|
+ handler.send('UnexpectedResponse', e);
|
|
} else {
|
|
} else {
|
|
- handler.send('UnknownError', {
|
|
|
|
- exception: new UnknownErrorException(e.message, e.toString())
|
|
|
|
- });
|
|
|
|
|
|
+ handler.send('UnknownError',
|
|
|
|
+ new UnknownErrorException(e.message, e.toString()));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|