Before you start - checklist
Description
Not sure if it's a bug or a feature. But when a PDF is rendered at default size using react-pdf, its size differs from the size when using PDF.js's "Actual size" option.
Specifically, react-pdf seems to take the values from the view property of PDFPageProxy and treat them as pixel, while they actually mean user points.
Steps to reproduce
- Simply render a PDF using react-pdf without passing
height, width, scale.
- Open the same PDF using pdf.js (e.g. https://mozilla.github.io/pdf.js/web/viewer.html) and set "Actual Size" as zoom option.
- Observe that the sizes of the two rendered PDFs differ.
Expected behavior
They should have the same size. In particular react-pdf should consider that the values in view are user points and convert them to pixel appropriately.
Actual behavior
react-pdf treats the values read from view as pixels.
Additional information
No response
Environment
- Browser (if applicable): Firefox 107.0
- React-PDF version: v6.2.0
- React version: 18.2.0
- Webpack version (if applicable):
Before you start - checklist
Description
Not sure if it's a bug or a feature. But when a PDF is rendered at default size using react-pdf, its size differs from the size when using PDF.js's "Actual size" option.
Specifically, react-pdf seems to take the values from the
viewproperty ofPDFPageProxyand treat them as pixel, while they actually mean user points.Steps to reproduce
height,width,scale.Expected behavior
They should have the same size. In particular react-pdf should consider that the values in
vieware user points and convert them to pixel appropriately.Actual behavior
react-pdf treats the values read from
viewas pixels.Additional information
No response
Environment