File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/react-pdf/src/Page Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,14 @@ export default function PageCanvas(props: PageCanvasProps) {
104
104
canvas . width = renderViewport . width ;
105
105
canvas . height = renderViewport . height ;
106
106
107
- canvas . style . width = `${ Math . floor ( viewport . width ) * pdfjs . PDF_TO_CSS_UNITS } pt` ;
108
- canvas . style . height = `${ Math . floor ( viewport . height ) * pdfjs . PDF_TO_CSS_UNITS } pt` ;
107
+
108
+ const CSS = 96.0 ;
109
+ const PDF = 72.0 ;
110
+ const PDF_TO_CSS_UNITS = CSS / PDF ;
111
+
112
+ canvas . style . width = `${ Math . floor ( viewport . width ) * PDF_TO_CSS_UNITS } px` ;
113
+ canvas . style . height = `${ Math . floor ( viewport . height ) * PDF_TO_CSS_UNITS } px` ;
114
+
109
115
canvas . style . visibility = 'hidden' ;
110
116
111
117
const renderContext : RenderParameters = {
You can’t perform that action at this time.
0 commit comments