Closed Maniae closed 3 days ago
This is because now the Bitmap is created by multiplying the zoom scale:
The best solution would be to crop the canvas to only the visible area, but this could be complex to handle when the user navigates within the zoomed area.
For now, you can limit the zoom to a level that doesn't cause a crash.
Android has a limitation on Bitmap size when rendering to a canvas: : https://stackoverflow.com/search?q=java.lang.RuntimeException%3A+Canvas%3A+trying+to+draw+too+large
To quickly solve this, I added a prop maxPageResolution
to limit the page resolution when zooming on Android.
Available in version 1.4.0
: https://github.com/douglasjunior/react-native-pdf-renderer/releases/tag/1.4.0
How did you link to the library (autolinking, manual, rn link, cocoapods)? Autolinking
What version of React Native? 0.74.5
What version of the library? 1.3.2
iOS/Android version? Android 13
Did the problem happen after updating React Native? No
Are you using the library for the first time? Yes
On Android, zooming inside a large/complex PDF file (over ~6Mo) causes the app to crash:
EDIT : This doesn't crash on version 1.2.0 (But the pdf rendering is kinda blurry)