Browse Source

PDF.js version 1.0.780

master v1.0.780
Yury Delendik 10 years ago
parent
commit
835d8294d8
  1. 2
      bower.json
  2. 102
      build/pdf.combined.js
  3. 65
      build/pdf.js
  4. 60
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.774", "version": "1.0.780",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",
"pdf", "pdf",

102
build/pdf.combined.js

@ -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.version = '1.0.780';
PDFJS.build = 'e096669'; 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, this.workerReadyCapability.reject(
data.exception); 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, this.workerReadyCapability.reject(
data.exception); 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) { messageHandler.on('MissingPDF', function transportMissingPDF(exception) {
this.workerReadyCapability.reject(data.exception.name, data.exception); this.workerReadyCapability.reject(
new MissingPDFException(exception.message));
}, this); }, this);
messageHandler.on('MissingPDF', function transportMissingPDF(data) { messageHandler.on('UnexpectedResponse',
this.workerReadyCapability.reject(data.exception.message, function transportUnexpectedResponse(exception) {
data.exception); this.workerReadyCapability.reject(
new UnexpectedResponseException(exception.message, exception.status));
}, this); }, this);
messageHandler.on('UnknownError', function transportUnknownError(data) { messageHandler.on('UnknownError',
this.workerReadyCapability.reject(data.exception.message, function transportUnknownError(exception) {
data.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 "' + exception = new MissingPDFException('Missing PDF "' +
source.url + '".'); source.url + '".');
handler.send('MissingPDF', { exception: exception }); handler.send('MissingPDF', exception);
} else { } else {
handler.send('DocError', 'Unexpected server response (' + exception = new UnexpectedResponseException(
status + ') while retrieving PDF "' + 'Unexpected server response (' + status +
source.url + '".'); ') 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', { handler.send('NeedPassword', e);
exception: e
});
} else if (e.code === PasswordResponses.INCORRECT_PASSWORD) { } else if (e.code === PasswordResponses.INCORRECT_PASSWORD) {
handler.send('IncorrectPassword', { handler.send('IncorrectPassword', e);
exception: e
});
} }
} else if (e instanceof InvalidPDFException) { } else if (e instanceof InvalidPDFException) {
handler.send('InvalidPDF', { handler.send('InvalidPDF', e);
exception: e
});
} else if (e instanceof MissingPDFException) { } else if (e instanceof MissingPDFException) {
handler.send('MissingPDF', { handler.send('MissingPDF', e);
exception: e } else if (e instanceof UnexpectedResponseException) {
}); handler.send('UnexpectedResponse', e);
} else { } else {
handler.send('UnknownError', { handler.send('UnknownError',
exception: new UnknownErrorException(e.message, e.toString()) new UnknownErrorException(e.message, e.toString()));
});
} }
}; };

65
build/pdf.js

@ -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.version = '1.0.780';
PDFJS.build = 'e096669'; 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) {
@ -2424,36 +2443,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, this.workerReadyCapability.reject(
data.exception); 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, this.workerReadyCapability.reject(
data.exception); 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) { messageHandler.on('MissingPDF', function transportMissingPDF(exception) {
this.workerReadyCapability.reject(data.exception.name, data.exception); this.workerReadyCapability.reject(
new MissingPDFException(exception.message));
}, this); }, this);
messageHandler.on('MissingPDF', function transportMissingPDF(data) { messageHandler.on('UnexpectedResponse',
this.workerReadyCapability.reject(data.exception.message, function transportUnexpectedResponse(exception) {
data.exception); this.workerReadyCapability.reject(
new UnexpectedResponseException(exception.message, exception.status));
}, this); }, this);
messageHandler.on('UnknownError', function transportUnknownError(data) { messageHandler.on('UnknownError',
this.workerReadyCapability.reject(data.exception.message, function transportUnknownError(exception) {
data.exception); this.workerReadyCapability.reject(
new UnknownErrorException(exception.message, exception.details));
}, this); }, this);
messageHandler.on('DataLoaded', function transportPage(data) { messageHandler.on('DataLoaded', function transportPage(data) {
@ -2549,10 +2578,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];

60
build/pdf.worker.js vendored

@ -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.version = '1.0.780';
PDFJS.build = 'e096669'; 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) {
@ -33387,14 +33406,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 "' + exception = new MissingPDFException('Missing PDF "' +
source.url + '".'); source.url + '".');
handler.send('MissingPDF', { exception: exception }); handler.send('MissingPDF', exception);
} else { } else {
handler.send('DocError', 'Unexpected server response (' + exception = new UnexpectedResponseException(
status + ') while retrieving PDF "' + 'Unexpected server response (' + status +
source.url + '".'); ') while retrieving PDF "' + source.url + '".', status);
handler.send('UnexpectedResponse', exception);
} }
}, },
@ -33446,26 +33467,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', { handler.send('NeedPassword', e);
exception: e
});
} else if (e.code === PasswordResponses.INCORRECT_PASSWORD) { } else if (e.code === PasswordResponses.INCORRECT_PASSWORD) {
handler.send('IncorrectPassword', { handler.send('IncorrectPassword', e);
exception: e
});
} }
} else if (e instanceof InvalidPDFException) { } else if (e instanceof InvalidPDFException) {
handler.send('InvalidPDF', { handler.send('InvalidPDF', e);
exception: e
});
} else if (e instanceof MissingPDFException) { } else if (e instanceof MissingPDFException) {
handler.send('MissingPDF', { handler.send('MissingPDF', e);
exception: e } else if (e instanceof UnexpectedResponseException) {
}); handler.send('UnexpectedResponse', e);
} else { } else {
handler.send('UnknownError', { handler.send('UnknownError',
exception: new UnknownErrorException(e.message, e.toString()) new UnknownErrorException(e.message, e.toString()));
});
} }
}; };

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.774", "version": "1.0.780",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

Loading…
Cancel
Save