Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only single page is shown #85

Open
alicompiler opened this issue Oct 22, 2017 · 6 comments
Open

only single page is shown #85

alicompiler opened this issue Oct 22, 2017 · 6 comments

Comments

@alicompiler
Copy link

alicompiler commented Oct 22, 2017

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 alicompiler changed the title only single page is showen only single page is shown Oct 22, 2017
@lucasbento
Copy link

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

@AnisDerbel
Copy link

+1

2 similar comments
@amosyang
Copy link

+1

@mark5566
Copy link

+1

@mark5566
Copy link

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

@okechukwu0127
Copy link

okechukwu0127 commented Mar 4, 2019

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants