// Firefox error reporting from XHR callbacks.
setTimeout(function pageSetTimeout() {
var exc = null;
- // try {
+ try {
self.display(gfx, continuation);
- // } catch (e) {
- // exc = e.toString();
- // continuation(exc);
- // throw e;
- // }
+ } catch (e) {
+ exc = e.toString();
+ continuation(exc);
+ throw e;
+ }
});
};
getIRQueue: function partialEvaluatorGetIRQueue(stream, resources,
queue, dependency) {
+ var self = this;
var xref = this.xref;
var handler = this.handler;
var uniquePrefix = this.uniquePrefix;
}
}
- var self = this;
function handleSetFont(fontName, fontRef) {
var loadedName = null;
// This adds the IRQueue of the xObj to the current queue.
var depIdx = dependency.length;
- this.getIRQueue(xobj, xobj.dict.get('Resources'), queue,
+ this.getIRQueue(xobj, xobj.dict.get('Resources'), queue,
dependency);
// Add the dependencies that are required to execute the
}
var CanvasGraphics = (function canvasGraphics() {
- // Defines the time the executeIRQueue gone be executing
+ // Defines the time the executeIRQueue gonna be executing
// before it stops and shedules a continue of execution.
var kExecutionTime = 50;
// Number of IR commands to execute before checking
var useWorker = false;
var WorkerPage = (function() {
- function constructor(workerPDF, page, objs) {
- this.workerPDF = workerPDF;
+ function constructor(pdf, page, objs) {
+ this.pdf = pdf;
this.page = page;
this.objs = objs;
// this.page.startRendering(ctx, callback, errback);
this.startRenderingTime = Date.now();
- this.workerPDF.startRendering(this);
+ this.pdf.startRendering(this);
},
startRenderingFromIRQueue: function(IRQueue, fonts) {
console.log('page=%d - total time: time=%dms',
pageNum, Date.now() - this.startRenderingTime);
- this.callback(err);
+ if (this.callback) {
+ this.callback(err);
+ }
}.bind(this);
this.page.startRenderingFromIRQueue(gfx, IRQueue, fonts, callback);
},
* Sets the data of an object but *doesn't* resolve it.
*/
setData: function(objId, data) {
- // Watchout! If you call `this.ensureObj(objId, data)` you'll gone create
+ // Watchout! If you call `this.ensureObj(objId, data)` you'll gonna create
// a *resolved* promise which shouldn't be the case!
this.ensureObj(objId).data = data;
}
console.log('page=%d - getIRQueue: time=%dms, len=%d', pageNum,
Date.now() - start, IRQueue.fnArray.length);
- if (false /* show used commands */) {
- var cmdMap = {};
-
- var fnArray = IRQueue .fnArray;
- for (var i = 0; i < fnArray.length; i++) {
- var entry = fnArray[i];
- if (entry == 'paintReadyFormXObject') {
- //console.log(preCompilation.argsArray[i]);
- }
- if (cmdMap[entry] == null) {
- cmdMap[entry] = 1;
- } else {
- cmdMap[entry] += 1;
- }
- }
- console.log('cmds', JSON.stringify(cmdMap));
- }
-
// Filter the dependecies for fonts.
var fonts = {};
for (var i = 0; i < dependency.length; i++) {