|
|
@ -15,7 +15,8 @@ |
|
|
|
* limitations under the License. |
|
|
|
* limitations under the License. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
/* globals RenderingStates, PDFJS, CustomStyle, CSS_UNITS, getOutputScale, |
|
|
|
/* globals RenderingStates, PDFJS, CustomStyle, CSS_UNITS, getOutputScale, |
|
|
|
TextLayerBuilder, AnnotationsLayerBuilder, Promise */ |
|
|
|
TextLayerBuilder, AnnotationsLayerBuilder, Promise, |
|
|
|
|
|
|
|
approximateFraction, roundToDivide */ |
|
|
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
@ -336,10 +337,12 @@ var PDFPageView = (function PDFPageViewClosure() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
canvas.width = (Math.floor(viewport.width) * outputScale.sx) | 0; |
|
|
|
var sfx = approximateFraction(outputScale.sx); |
|
|
|
canvas.height = (Math.floor(viewport.height) * outputScale.sy) | 0; |
|
|
|
var sfy = approximateFraction(outputScale.sy); |
|
|
|
canvas.style.width = Math.floor(viewport.width) + 'px'; |
|
|
|
canvas.width = roundToDivide(viewport.width * outputScale.sx, sfx[0]); |
|
|
|
canvas.style.height = Math.floor(viewport.height) + 'px'; |
|
|
|
canvas.height = roundToDivide(viewport.height * outputScale.sy, sfy[0]); |
|
|
|
|
|
|
|
canvas.style.width = roundToDivide(viewport.width, sfx[1]) + 'px'; |
|
|
|
|
|
|
|
canvas.style.height = roundToDivide(viewport.height, sfy[1]) + 'px'; |
|
|
|
// Add the viewport so it's known what it was originally drawn with.
|
|
|
|
// Add the viewport so it's known what it was originally drawn with.
|
|
|
|
canvas._viewport = viewport; |
|
|
|
canvas._viewport = viewport; |
|
|
|
|
|
|
|
|
|
|
|