Browse Source

PDF.js version 1.0.284

master v1.0.284
Yury Delendik 11 years ago
parent
commit
05f138a71d
  1. 2
      bower.json
  2. 23
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 23
      build/pdf.worker.js
  5. 2
      package.json
  6. 8
      web/compatibility.js

2
bower.json

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

23
build/pdf.combined.js

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.281'; PDFJS.version = '1.0.284';
PDFJS.build = 'c7c1639'; PDFJS.build = '5ded0ea';
(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
@ -6893,8 +6893,7 @@ var NetworkManager = (function NetworkManagerClosure() {
} }
function getArrayBuffer(xhr) { function getArrayBuffer(xhr) {
var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse || var data = xhr.response;
xhr.responseArrayBuffer || xhr.response);
if (typeof data !== 'string') { if (typeof data !== 'string') {
return data; return data;
} }
@ -6946,7 +6945,7 @@ var NetworkManager = (function NetworkManagerClosure() {
pendingRequest.expectedStatus = 200; pendingRequest.expectedStatus = 200;
} }
xhr.mozResponseType = xhr.responseType = 'arraybuffer'; xhr.responseType = 'arraybuffer';
if (args.onProgress) { if (args.onProgress) {
xhr.onprogress = args.onProgress; xhr.onprogress = args.onProgress;
@ -43785,20 +43784,6 @@ var JpxImage = (function JpxImageClosure() {
this.failOnCorruptedImage = false; this.failOnCorruptedImage = false;
} }
JpxImage.prototype = { JpxImage.prototype = {
load: function JpxImage_load(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.onload = (function() {
// TODO catch parse error
var data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer);
this.parse(data);
if (this.onload) {
this.onload();
}
}).bind(this);
xhr.send(null);
},
parse: function JpxImage_parse(data) { parse: function JpxImage_parse(data) {
var head = readUint16(data, 0); var head = readUint16(data, 0);

4
build/pdf.js

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.281'; PDFJS.version = '1.0.284';
PDFJS.build = 'c7c1639'; PDFJS.build = '5ded0ea';
(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

23
build/pdf.worker.js vendored

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.281'; PDFJS.version = '1.0.284';
PDFJS.build = 'c7c1639'; PDFJS.build = '5ded0ea';
(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
@ -2386,8 +2386,7 @@ var NetworkManager = (function NetworkManagerClosure() {
} }
function getArrayBuffer(xhr) { function getArrayBuffer(xhr) {
var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse || var data = xhr.response;
xhr.responseArrayBuffer || xhr.response);
if (typeof data !== 'string') { if (typeof data !== 'string') {
return data; return data;
} }
@ -2439,7 +2438,7 @@ var NetworkManager = (function NetworkManagerClosure() {
pendingRequest.expectedStatus = 200; pendingRequest.expectedStatus = 200;
} }
xhr.mozResponseType = xhr.responseType = 'arraybuffer'; xhr.responseType = 'arraybuffer';
if (args.onProgress) { if (args.onProgress) {
xhr.onprogress = args.onProgress; xhr.onprogress = args.onProgress;
@ -39278,20 +39277,6 @@ var JpxImage = (function JpxImageClosure() {
this.failOnCorruptedImage = false; this.failOnCorruptedImage = false;
} }
JpxImage.prototype = { JpxImage.prototype = {
load: function JpxImage_load(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.onload = (function() {
// TODO catch parse error
var data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer);
this.parse(data);
if (this.onload) {
this.onload();
}
}).bind(this);
xhr.send(null);
},
parse: function JpxImage_parse(data) { parse: function JpxImage_parse(data) {
var head = readUint16(data, 0); var head = readUint16(data, 0);

2
package.json

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

8
web/compatibility.js

@ -160,9 +160,13 @@ if (typeof PDFJS === 'undefined') {
value: function xmlHttpRequestOverrideMimeType(mimeType) {} value: function xmlHttpRequestOverrideMimeType(mimeType) {}
}); });
} }
if ('response' in xhr || 'responseArrayBuffer' in xhr) { if ('responseType' in xhr) {
return; return;
} }
// The worker will be using XHR, so we can save time and disable worker.
PDFJS.disableWorker = true;
// Support: IE9 // Support: IE9
if (typeof VBArray !== 'undefined') { if (typeof VBArray !== 'undefined') {
Object.defineProperty(xhrPrototype, 'response', { Object.defineProperty(xhrPrototype, 'response', {
@ -189,7 +193,7 @@ if (typeof PDFJS === 'undefined') {
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
result[i] = text.charCodeAt(i) & 0xFF; result[i] = text.charCodeAt(i) & 0xFF;
} }
return result; return result.buffer;
} }
Object.defineProperty(xhrPrototype, 'response', { get: responseGetter }); Object.defineProperty(xhrPrototype, 'response', { get: responseGetter });
})(); })();

Loading…
Cancel
Save