Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pdf File not found #238

Open
Open
Labels
wontfixThis will not be worked on

Description

I'm using react-native-fs for downloading the pdf and saving it.

let url = 'http://samples.leanpub.com/thereactnativebook-sample.pdf';

const getPdfName = () => {
return url.split('/').pop();
};

RNFS.downloadFile({
fromUrl: url,
toFile: ${RNFS.DocumentDirectoryPath}/${getPdfName()},
}).promise.then(r => {
let path = ${RNFS.DocumentDirectoryPath}/${getPdfName()};
setFilePath(path);
});

const resourceType = 'file';
const resources = {
file: 'thereactnativebook-sample.pdf',
};

<PDFView
fadeInDuration={250.0}
style={styles.pdfStyle}
resource={resources[resourceType]}
resourceType={resourceType}
onLoad={() => console.log(PDF rendered from ${resourceType})}
onError={error => console.log('Cannot render PDF', error)}
/>

Getting error 'Pdf file not found. While code works fine with URL-type resources.

Version:-
"react": "18.1.0",
"react-native": "0.70.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /