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

only single page is shown

Open alicompiler opened this issue 7 years ago • 6 comments

only single page is shown when I display PDF file that have 2 pages

import React , {Component} from 'react';
import {WebView , Dimensions , Platform} from 'react-native';
import {Container , Content} from 'native-base';
import HeaderLeft from '../../component/app/header/HeaderLeft';
import PDFView from 'react-native-pdf-view';

export default class PDFScreen extends Component
{
    constructor(props)
    {
        super(props);

        const {width} = Dimensions.get('window');
        this.state = {width : width};
    }

    onLayout()
    {
        const {width} = Dimensions.get('window');
        this.setState({width : width});
    }


    render()
    {
        let path =  this.props.navigation.state.params.filePath;
        console.log(path);

        return (
            <Container style={{backgroundColor : '#FFFFFF'}} onLayout={this.onLayout.bind(this)}>
                <HeaderLeft title="قراءة" navigation={this.props.navigation}/>
                <Content style={{flexDirection : 'row'}}>
                    {
                            <PDFView
                                path={path}
                                style={{flex:1 , backgroundColor : '#2B2B2B' , width : this.state.width}}/>
                    }
                </Content>
            </Container>
        )
    }
}

alicompiler avatar Oct 22 '17 19:10 alicompiler

@alicompiler: have you managed to find a workaround for this?

lucasbento avatar Feb 12 '18 12:02 lucasbento

+1

AnisDerbel avatar Apr 16 '18 08:04 AnisDerbel

+1

amosyang avatar Jul 10 '18 06:07 amosyang

+1

mark5566 avatar Sep 10 '18 09:09 mark5566

and the function that is 'onLoadComplete' was called twice,first pageCount = 0,and second page is actually pages

mark5566 avatar Sep 10 '18 09:09 mark5566

I am also having this issue, as my scroll gets stocked on page one of the PDF.. PLATEORM : ANDROID Can u pls explain how i can make it scroll to ther pages ?

okechukwu0127 avatar Mar 04 '19 18:03 okechukwu0127