xcarpentier / rn-pdf-reader-js

📄 PDF reader in JavaScript only for Expo - Android & iOS capable
MIT License
388 stars 164 forks source link

Error: pdf uri not working on Android #188

Open aleffarias opened 1 year ago

aleffarias commented 1 year ago

Issue Description

I'm trying to render the pdf through the uri but I get the following error. This happens for any valid uri

Steps to Reproduce / Code Snippets

My code:

        <PdfReader
          source={{
            uri: 'https://www.thecampusqdl.com/uploads/files/pdf_sample_2.pdf',
          }}
          withPinchZoom
          webviewStyle={[
            {
              marginTop: 80,
            },
            Platform.OS === 'android' && {
              backgroundColor: theme.colors.primary,
            },
          ]}
          style={Platform.OS === 'ios' && { marginTop: 30 }}
          withScroll
        />

error: Captura de Tela 2023-03-27 às 13 52 01

Expected Results

render pdf

Additional Information

SBRKH commented 1 year ago

Try : source={{uri:${encodeURIComponent('https://www.thecampusqdl.com/uploads/files/pdf_sample_2.pdf'l)}}

zohaibasgharIGS commented 1 year ago

i am getting error [TypeError: Cannot convert null value to object]

rss14 commented 1 year ago

Também recebo o mesmo erro... me parece que este pacote foi abandonado :(

delonzhou commented 1 year ago

i am getting error [TypeError: Cannot convert null value to object]

Got the same issue. After some debugging, found it can't be fixed by a very small change. You can refer to the pull request https://github.com/xcarpentier/rn-pdf-reader-js/pull/198 and find the details.