|
@@ -1044,10 +1044,15 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|
|
// better output until bug 811002 is fixed in FF.
|
|
|
var PRINT_OUTPUT_SCALE = 2;
|
|
|
var canvas = document.createElement('canvas');
|
|
|
+
|
|
|
+ // The logical size of the canvas.
|
|
|
canvas.width = Math.floor(viewport.width) * PRINT_OUTPUT_SCALE;
|
|
|
canvas.height = Math.floor(viewport.height) * PRINT_OUTPUT_SCALE;
|
|
|
- canvas.style.width = (PRINT_OUTPUT_SCALE * viewport.width) + 'pt';
|
|
|
- canvas.style.height = (PRINT_OUTPUT_SCALE * viewport.height) + 'pt';
|
|
|
+
|
|
|
+ // The rendered size of the canvas, relative to the size of canvasWrapper.
|
|
|
+ canvas.style.width = (PRINT_OUTPUT_SCALE * 100) + '%';
|
|
|
+ canvas.style.height = (PRINT_OUTPUT_SCALE * 100) + '%';
|
|
|
+
|
|
|
var cssScale = 'scale(' + (1 / PRINT_OUTPUT_SCALE) + ', ' +
|
|
|
(1 / PRINT_OUTPUT_SCALE) + ')';
|
|
|
CustomStyle.setProp('transform' , canvas, cssScale);
|