#123, part 2: move more PDF-page rendering stuff into pdf.js

This commit is contained in:
Chris Jones 2011-07-10 23:21:13 -07:00
parent 47c29974c4
commit 452ba3d85b
4 changed files with 62 additions and 82 deletions

View file

@ -123,14 +123,7 @@ var PDFViewer = {
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.restore();
var gfx = new CanvasGraphics(ctx);
// page.compile will collect all fonts for us, once we have loaded them
// we can trigger the actual page rendering with page.display
var fonts = [];
page.compile(gfx, fonts);
FontLoader.bind(fonts, function() { page.display(gfx); });
page.startRendering(ctx, function() { });
}
},
@ -183,14 +176,7 @@ var PDFViewer = {
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.restore();
var gfx = new CanvasGraphics(ctx);
// page.compile will collect all fonts for us, once we have loaded them
// we can trigger the actual page rendering with page.display
var fonts = [];
page.compile(gfx, fonts);
FontLoader.bind(fonts, function() { page.display(gfx); });
page.startRendering(ctx, function() { });
}
},