Open Sanket8304 opened 2 weeks ago
<Pdf
ref={pdfRef}
trustAllCerts={false}
source={{
uri,
}}
onLoadProgress={(percent) => calculateLoadingProgress(percent)}
style={{
width,
height,
}}
onPageSingleTap={(e, x, y) => handlePosition(e, x, y)}
onLoadComplete={(numberOfPages, path, { height, width }) =>
console.log(`height & width : ${height} ${width}`)
}
/>
Try this code my pdf is zooming fine
<Pdf ref={pdfRef} trustAllCerts={false} source={{ uri, }} onLoadProgress={(percent) => calculateLoadingProgress(percent)} style={{ width, height, }} onPageSingleTap={(e, x, y) => handlePosition(e, x, y)} onLoadComplete={(numberOfPages, path, { height, width }) => console.log(`height & width : ${height} ${width}`) } />
Try this code my pdf is zooming fine
@rajivchaulagain can you please help me with handlePosition function. I'm not getting idea from this. How use this function?
const [position, setPosition] = useState({ x: 0, y: 0 });
const handlePosition = (e, x, y) => {
setPosition({ x, y });
console.log("p", e, x, y);
};
react-native:- "0.71.7" react-native-pdf:- "^6.7.5" platform:- on both devices iOS and Android
Describe your issue as precisely as possible : I have implemented singlePage pdf viewer to render specific page of the given pdf in source, but it is restricting the double tap/pinch to zoom functionality
Here is my code which I'm using to render the PDF in my react native project:-