wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
9.01k stars 861 forks source link

[breaking] Treat pts as pts #1717

Open courtneypattison opened 5 months ago

courtneypattison commented 5 months ago

Sets the scale to the actual size of PDF :)

Fixes #1219

wojtekmaj commented 5 months ago

Oooooo that's just lovely! Thank you for that!

I'll happily release this, but in the next major, as this change might end up being very impactful on people's UIs.

Also, we may need some documentation change? Not sure, will have to look into that.

courtneypattison commented 5 months ago

You're welcome! I'm sorry, I was rushing and messed up the commit. It should be pixels instead of points since the conversion is from pdf to css pixels. Also, the util from pdfjs isn't accessible so I just copied it out. I think it makes what is going on more explicit anyway. Hopefully it's correct this time!

wojtekmaj commented 5 months ago

That looks good to me! My point stands though - I'll be merging this in the next major release. :) Thanks!

courtneypattison commented 5 months ago

Great, thank you @wojtekmaj!