christopherdro / react-native-html-to-pdf

Convert html strings to PDF documents using React Native
MIT License
434 stars 264 forks source link

Preview PDF after creating #286

Open Shivani12345 opened 1 year ago

Shivani12345 commented 1 year ago

can we preview PDF with this library with file path?

tarekhassan410 commented 1 year ago

I have the same question

BraveEvidence commented 1 year ago

This will help https://www.youtube.com/watch?v=4CBUXv8d0I0

zoobibackups commented 1 year ago

cannot find the file in iOS

timothytripp commented 1 year ago

You can use something like this:

import FileViewer from 'react-native-file-viewer';

let file = await RNHTMLtoPDF.convert({
    html: html,
    fileName: 'My PDF File',
    directory: 'Documents',
  });

if(file?.filePath) {
  FileViewer.open(filePath);
stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.