Skip to content

Commit f9d2f15

Browse files
courtneypattisonwojtekmaj
authored andcommitted
Treats pts as pts
1 parent ce726c4 commit f9d2f15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-pdf/src/Page/Canvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ export default function Canvas(props: CanvasProps): React.ReactElement {
106106
canvas.width = renderViewport.width;
107107
canvas.height = renderViewport.height;
108108

109-
canvas.style.width = `${Math.floor(viewport.width)}px`;
110-
canvas.style.height = `${Math.floor(viewport.height)}px`;
109+
canvas.style.width = `${Math.floor(viewport.width) * pdfjs.PixelsPerInch.PDF_TO_CSS_UNITS}pt`;
110+
canvas.style.height = `${Math.floor(viewport.height) * pdfjs.PixelsPerInch.PDF_TO_CSS_UNITS}pt`;
111111
canvas.style.visibility = 'hidden';
112112

113113
const renderContext: RenderParameters = {

0 commit comments

Comments
 (0)