commit
a6c3a46ab4
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
getPdf('helloworld.pdf', function(data){
|
getPdf('helloworld.pdf', function getPdfHelloWorld(data) {
|
||||||
//
|
//
|
||||||
// Instantiate PDFDoc with PDF data
|
// Instantiate PDFDoc with PDF data
|
||||||
//
|
//
|
||||||
|
6
pdf.js
6
pdf.js
@ -130,11 +130,11 @@ function getPdf(arg, callback) {
|
|||||||
xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200;
|
xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200;
|
||||||
xhr.onprogress = params.progress || undefined;
|
xhr.onprogress = params.progress || undefined;
|
||||||
|
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function getPdfOnreadystatechange() {
|
||||||
var data;
|
var data;
|
||||||
if (xhr.readyState === 4 && xhr.status === xhr.expected) {
|
if (xhr.readyState === 4 && xhr.status === xhr.expected) {
|
||||||
data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
|
data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
|
||||||
xhr.responseArrayBuffer || xhr.response);
|
xhr.responseArrayBuffer || xhr.response);
|
||||||
callback(data);
|
callback(data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -4979,7 +4979,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
|||||||
if (IsDict(extGState) && extGState.has(dictName.name)) {
|
if (IsDict(extGState) && extGState.has(dictName.name)) {
|
||||||
var gsState = this.xref.fetchIfRef(extGState.get(dictName.name));
|
var gsState = this.xref.fetchIfRef(extGState.get(dictName.name));
|
||||||
var self = this;
|
var self = this;
|
||||||
gsState.forEach(function(key, value) {
|
gsState.forEach(function canvasGraphicsSetGStateForEach(key, value) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'Type':
|
case 'Type':
|
||||||
break;
|
break;
|
||||||
|
@ -73,7 +73,7 @@ function nextTask() {
|
|||||||
|
|
||||||
log('Loading file "' + task.file + '"\n');
|
log('Loading file "' + task.file + '"\n');
|
||||||
|
|
||||||
getPdf(task.file, function(data){
|
getPdf(task.file, function nextTaskGetPdf(data) {
|
||||||
var failure;
|
var failure;
|
||||||
try {
|
try {
|
||||||
task.pdfDoc = new PDFDoc(data);
|
task.pdfDoc = new PDFDoc(data);
|
||||||
|
@ -107,7 +107,7 @@ var PDFView = {
|
|||||||
|
|
||||||
document.title = url;
|
document.title = url;
|
||||||
|
|
||||||
getPdf({url:url, progress:PDFView.progressLevel}, function(data) {
|
getPdf({url: url, progress: PDFView.progressLevel}, function(data) {
|
||||||
document.getElementById('loading').style.display = 'none';
|
document.getElementById('loading').style.display = 'none';
|
||||||
PDFView.load(data, scale);
|
PDFView.load(data, scale);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user