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:
parent
5608f8e445
commit
b312719d7e
6 changed files with 109 additions and 93 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue