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

Pages Won't Scroll

Open clozr opened this issue 10 years ago • 18 comments

The pdf renders alright, however it renders only the first page and doesn't scroll. Is there anything I am missing?

clozr avatar Apr 20 '16 19:04 clozr

Is the iOS or android ?

cnjon avatar Apr 21 '16 02:04 cnjon

I also got same problem in IOS. It is working good in android... Can anyone help me quickly please.

kamalkrishna3000 avatar Apr 21 '16 09:04 kamalkrishna3000

@sibeliusseraphini Can you help to fix?

cnjon avatar Apr 22 '16 01:04 cnjon

@kamalkrishna3000 take a look in this branch https://github.com/cnjon/react-native-pdf-view/tree/feature/swift

it is almost done.

You can also use another component to scroll or swipe between pdf pages, for now it only show one page

sibelius avatar Apr 28 '16 15:04 sibelius

I am facing this too.

bhumit1709 avatar Jul 27 '16 12:07 bhumit1709

I'm having issues with iOS scrolling as well

robputer avatar Aug 11 '16 17:08 robputer

on android works great but on ios zoom out makes pdf view looks so little on the same pdfview and scrolling not working

Burak07 avatar Aug 24 '16 11:08 Burak07

same problem here

andrejunges avatar Sep 16 '16 13:09 andrejunges

Any update on this? It's been many months since it was "almost done". Has it been merged? I'm guessing not since I installed the latest version a couple days ago and it still has this problem on iOS.

pedramsaleh avatar Oct 13 '16 14:10 pedramsaleh

same problem here, any update on this please? 👍

cinder92 avatar Oct 25 '16 07:10 cinder92

I just gave up and rendered it using WebView on iOS.

pedramsaleh avatar Oct 25 '16 19:10 pedramsaleh

@pedramsaleh i do the same, but i can not zoom :c

cinder92 avatar Oct 25 '16 20:10 cinder92

Maybe try react-native-quick-look? Using that now and zooming works fine.

pedramsaleh avatar Oct 26 '16 15:10 pedramsaleh

Do not use this component to display PDF on IOS .
on IOS can use webview display PDF.

this.pdfPath = RNFS.DocumentDirectoryPath + /tour.pdf; <WebView source={{uri: this.pdfPath}} style={{flex: 1, backgroundColor: 'white'}} scalesPageToFit={true} /> 'this.pdfPath' should be the path in Xcode project.

NextChampion avatar Jan 10 '17 09:01 NextChampion

Can anyone solved this ? I am try using WebView but cannot open pdf Local Directory on iOS. my this.pdfPath = /Users/rezaarifiansyah/Library/Developer/CoreSimulator/Devices/3F9E5A72-FE37-42D0-AB99-84F86974373D/data/Containers/Data/Application/E350A5C9-212E-4EEA-9F61-6E1492810FB5/Documents/5d7d57f1abfac97dd29ff7c7ae159846

@NextChampion can you help me to use WebView .

Thanks

rezaarifian avatar Feb 25 '17 10:02 rezaarifian

1 copy the Local path; 2 Open Finder ; 3 command + shift + g ; 4 paste ; 5 enter ; @rezaarifian

NextChampion avatar Mar 07 '17 07:03 NextChampion

+1

Component would be even better with scroll...

KristoferEng avatar Mar 10 '17 19:03 KristoferEng

Hi! In my project, I use https://github.com/philipshurpik/react-native-animated-tabs to make beautifully animated swiping between pages. Here is the example of render method you can try:

render() {
	const {uri} = this.props;
	const {pageCount} = this.state;

	return <View style={commonStyles.flexContainer}>
		{uri && <AnimatedTabs
			panelWidth={Dimensions.get('window').width}
			style={styles.tabs}
			onMoveShouldSetPanResponder={(a, e) => {
				return Math.abs(e.dx) > 30 && Math.abs(e.dx) > Math.abs(e.dy) * 1.5;
			}}
		>
			{(new Array(pageCount)).fill().map((i, pageNumber) => <PDFView
				key={pageNumber}
				path={uri}
				pageNumber={pageNumber + 1}
				zoom={0.90}
				borderWidth={0}
				backgroundColor={colors.bgGray}
				style={styles.pdf}
				onLoadComplete={pageCount => this.setState({pageCount})}
			/>)}
		</AnimatedTabs>}
	</View>
}

philipshurpik avatar Jun 21 '17 12:06 philipshurpik