react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

Cannot remove padding

Open meliodev opened this issue 5 years ago • 6 comments

Hi guys, I used enablePaging={true} and I need to remove the paddings as shown on the screenshot bellow (yellow). The issue is that onLoadComplete outputs a height that includes the paddingTop and paddingBottom. However I need the height of the content only. Is there any solution or work around for this ?? `<View style={styles.container}> <Pdf minScale={1.0} maxScale={1.0} scale={1.0} spacing={0} fitPolicy={0} enablePaging={true} source={{ uri: filePath }}

                onLoadComplete={(numberOfPages, filePath, { width, height }) => {
                    console.log(`number of pages: ${numberOfPages}`);
                    console.log(`width: ${width}`);
                    console.log(`height: ${height}`);
                }}
                onPageChanged={(page, numberOfPages) => {
                    console.log(`current page: ${page}`);
                }}
                onError={(error) => {
                    console.log(error);
                }}
                onPressLink={(uri) => {
                    console.log(`Link presse: ${uri}`)
                }}
                style={styles.pdf} />
        </View>

const styles = StyleSheet.create({ container: { flex: 1, alignItems: "center", marginTop: 25, backgroundColor: "#f4f4f4" }, pdf: { width: Dimensions.get("window").width, height: Dimensions.get("window").height, paddingTop: 0 } });`

Screenshot_20201122-010350_Synergys

meliodev avatar Nov 22 '20 00:11 meliodev

I have the same problem, did you find a solution?

defcore avatar Dec 01 '20 10:12 defcore

I also have this problem, any solutions?

k-koehler avatar Dec 03 '20 23:12 k-koehler

nope :/

meliodev avatar Dec 04 '20 16:12 meliodev

me too!!

kanglang avatar Jan 07 '21 02:01 kanglang

i also have this problem any solutions

jaya-prakash11 avatar May 09 '24 11:05 jaya-prakash11

Same problem

huuphat1908 avatar Jun 26 '24 17:06 huuphat1908