Ask Your Question
2

Is it impossible to upload a local PDF file on react-native-view-pdf?

asked 2023-05-03 11:43:21 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-03 12:09:01 +0000

devzero gravatar image

No, it is possible to upload a local PDF file on react-native-view-pdf. You can use the "source" prop to specify the path of the local PDF file. Here is an example:

import React from 'react';
import { View } from 'react-native';
import PDFView from 'react-native-view-pdf';

const MyPDFViewer = () => {
  return (
    <View style={{ flex: 1 }}>
      <PDFView
        source={{ uri: '/path/to/local/file.pdf' }}
        style={{ flex: 1 }}
      />
    </View>
  );
};

export default MyPDFViewer;

Note that the path to the file should be relative to the root folder of your project.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-03 11:43:21 +0000

Seen: 9 times

Last updated: May 03 '23