Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

462
Views
Save pdf to desired location in device React Native

I'm using RNHTMLtoPDF from 'react-native-html-to-pdf' and I want to store to my desired location so what should I do? I have a path that is storage emulated and that path is saved in a hook but I want this pdf downloaded to be in my device storage. Any help regarding this matter would be highly appreciated

enter image description here

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

maybe add a standard 'share' component from react-native?

https://reactnative.dev/docs/share

and the logic is when you click on pdf or whatever button you have - the share component will be opened and then you'll choose where you want to put that file(also to save it on your phone)

about 4 years ago · Juan Pablo Isaza Report

0

You can use npm i react-native-fs library for save in local devices

Sample Code:

import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import RNFS from 'react-native-fs';

export default function App() {

  //if you want to save in download directory then you can use this path
  const path = RNFS.DownloadDirectoryPath;

  const saveFile = () => {
    RNFS.copyFile(yourCurrentFilePath, yourDestinationFilePath);
  };

  return (
    <View style={{flex: 1}}>
      <TouchableOpacity onPress={() => saveFile()}>
        <Text>Save</Text>
      </TouchableOpacity>
    </View>
  );
}

For More Information you can explore the react-native-fs library documents react-native-fs

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!