Closed export-mike closed 5 years ago
There no API of react-native-pdf can do this now. Maybe you can add an transparent cover on it...
hmm interesting to prevent touches?
would this then prevent scaling? pinch to zoom etc?
@export-mike Easy method: I use a view to block scroll event. Then use @dudigital/react-native-zoomable-view as wrapper for pinch zoom and drag move. This way is fast and easy. But pdf resolution will not change when zoom in/out.
Custom method: I just made a custom as you want. It work perfectly on iOS support PDFKit. But android still have a bug can see apart or move to another page. See (https://github.com/LVBK/react-native-pdf) more detail.
If you find out something cool. Please share with me :)
You also can try enablePaging=true minScale=1 maxScale=1
It can only show one page and can not scroll/zoom.
If you just want to block touch events, use <View pointerEvents={'none'} />
If you just want to block touch events, use
<View pointerEvents={'none'} />
I tried with this, and it worked, but when I changed the state dynamically from 'none' to 'auto' (or the other way around), the components were reloaded, and I lost the initial zoom value, So what I ended up doing was adding an absolute View on top of the PDF component
Hey, what if I want to disable scroll but still want option to zoom...
I want to add the pdf viewer to a Scrollview so a user can scroll past the PDF viewer.
I can do this just fine with a react-native-webview scrollEnabled={false}
Or are there any ideas on how I can do this with the existing API for react-native-pdf?