1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Fixes test driver and examples

This commit is contained in:
Yury Delendik 2012-04-12 08:23:38 -07:00
parent 5608f8e445
commit b312719d7e
6 changed files with 109 additions and 93 deletions

View file

@ -176,11 +176,9 @@ function nextPage(task, loadError) {
var ctx = canvas.getContext('2d');
task.pdfDoc.getPage(task.pageNum).then(function(page) {
var pdfToCssUnitsCoef = 96.0 / 72.0;
// using mediaBox for the canvas size
var pageWidth = page.width;
var pageHeight = page.height;
canvas.width = pageWidth * pdfToCssUnitsCoef;
canvas.height = pageHeight * pdfToCssUnitsCoef;
var viewport = page.getViewport(pdfToCssUnitsCoef);
canvas.width = viewport.width;
canvas.height = viewport.height;
clear(ctx);
// using the text layer builder that does nothing to test