react-native-pdf
react-native-pdf copied to clipboard
Left/Right Padding Remains When Zoomed
What react-native
version are you using?
0.61.5
What react-native-pdf
version are you using?
6.1.2
What platform does your issue occur on? (android/ios/both) ios
Describe your issue as precisely as possible : Trying to add padding on left and right sides of pdf, but the padding remains when I pinch zoom. Is there any way to work around this?
Code: The way I added left/right padding was by adding the following styling to the pdf object's style prop.
pdf: { flex: 1, width: Dimensions.get('window').width-20, height: Dimensions.get('window').height, backgroundColor:'rgba(227, 227, 227, 1)', padding:10, },
I’m also having this issue with IOS.
As a workaround you could use a scale lower than 1 to simulate the lateral padding instead of using a padding.
Example: scale : 0.9 minScale: 0.9
Same. I did:
const padding = 20
const percentageFromPadding =
(dimensions.width - padding * 2) / dimensions.width
return (
...
<Pdf
scale={percentageFromPadding}
minScale={percentageFromPadding}
0.9
is close, but this is exact ;)