react-native-pdf-view
react-native-pdf-view copied to clipboard
only single page is shown
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: have you managed to find a workaround for this?
+1
+1
+1
and the function that is 'onLoadComplete' was called twice,first pageCount = 0,and second page is actually pages
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 ?