In this video you will learn how to create PDF from HTML, we will use invoice HTML code and export it into PDF and add user data, and then open PDF from app.
🕙 Timestamps ►
0:40 – react-native-html-to-pdf installation
0:54 – package configuration
6:02 – react-native-file-viewer installation
6:34 – react-native-file-viewer configuration
📑 Source code:
Like 👍 Share 📢 and Subscribe 🚀…(read more)
Convert Word 2 PDF: Word to PDF Converter
Convert PowerPoint 2 PDF: PPT to PDF Converter
Convert Excel 2 PDF: Excel to PDF Converter
Convert an Image 2 PDF: Image to PDF Converter
Convert HTML 2 PDF: HTML to PDF Converter
More Tools: PDF Converter
cool
hello, I have followed the same but getting error like ' Cannot call a class as a function' can you please help
congratulations thank you
does anyone has a problem saying possible unhandled promise rejection? please help
getting error "Possible Unhandled Promise Rejection (id: 6):
ReferenceError: Can't find variable: RNHTMLtoPDF
_callee$" help any solution?
i got [TypeError: Cannot read property 'startsWith' of undefined] when opening file path. I'm using TypeScript and paste all your code to my project.
let file = await RNHTMLtoPDF.convert(Options)
Alert.alert('Thông báo','Xuất file PDF thành công:' + file.filePath,[
{text:'Cancel',style:'cancel'},
{text:'Open',onPress:()=>openFile(file.filepath)}
],{cancelable:true});
}
const openFile = (filepath: any) => {
const path = filepath;
FileViewer.open(path)
.then(()=>{
//success
console.log(`Successfully export PDF file`);
})
.catch(error => {
console.log(error);
});
}
in this video when you export pdf it is stored in/storage/emulated/0/Download/—.pdf and I followed same procedure but the file is storing in root directory of the application i.e. /storage/emulated/0/Android/data/com.mypackage/files/Download/—.pdf
Any idea what to do about this?? or plz update all package and check if your app is still working fine
is there's more permission code? coz I just followed your steps but mine don't work in Android..:(
Checkout Expo Example: https://youtu.be/fnwiIWUlo8U
Source Code: https://github.com/vishalpwr/Expo-App
What do i do to make this pdf file shareable too?
Please how can create multiple pages inside the pdf library is very adjust.
How do I save the file in a specific folder on my device, it is saving in the com. from the app that is there in androiddatamediacom.myapp ?
I am getting permission error
How to use state data in this, data being an array iterating over it and making dynamic table ?
Hi, I'm desperately looking to create Header/Footer in each pages in my pdf. Do you know a solution ? Thanks !
Thank you! Your video helped me a lot
why if I use it in the expo can't ?
How did you get the html code of that pdf file? I mean I need to do something similar, but with a different pdf document. The problem is that I dont know how to convert it into html.
Could you generate a pdf but with data extracted from the database? I would love for you to show an example greetings from Mexico