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:
parent
ad02c82f6a
commit
4377eed920
5 changed files with 53 additions and 11 deletions
|
@ -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
BIN
test/pdfs/rotation.pdf
Normal file
Binary file not shown.
|
@ -75,5 +75,10 @@
|
|||
"link": true,
|
||||
"rounds": 1,
|
||||
"type": "load"
|
||||
},
|
||||
{ "id": "rotation",
|
||||
"file": "pdfs/rotation.pdf",
|
||||
"rounds": 1,
|
||||
"type": "load"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue