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

Adding support for page rotation

This commit is contained in:
Brendan Dahl 2011-08-06 14:41:18 -07:00
parent ad02c82f6a
commit 4377eed920
5 changed files with 53 additions and 11 deletions

View file

@ -105,8 +105,8 @@ function nextPage(task, loadError) {
var pdfToCssUnitsCoef = 96.0 / 72.0;
// using mediaBox for the canvas size
var pageWidth = (page.mediaBox[2] - page.mediaBox[0]);
var pageHeight = (page.mediaBox[3] - page.mediaBox[1]);
var pageWidth = page.width;
var pageHeight = page.height;
canvas.width = pageWidth * pdfToCssUnitsCoef;
canvas.height = pageHeight * pdfToCssUnitsCoef;
clear(ctx);

BIN
test/pdfs/rotation.pdf Normal file

Binary file not shown.

View file

@ -75,5 +75,10 @@
"link": true,
"rounds": 1,
"type": "load"
},
{ "id": "rotation",
"file": "pdfs/rotation.pdf",
"rounds": 1,
"type": "load"
}
]