Hi, your library was be useful for my project that i had been working, but when i went to set text from variable, it displayed "undefined ". My code look like 👍
cretePDF
= ({name}) => () => {
const fs = RNFetchBlob.fs;
const dirs = fs.dirs;
// Create page
const page1 = PDFPage.create()
.setMediaBox(Dimensions.get('window').width, Dimensions.get('window').height)
.drawRectangle({
x: 0,
y: Dimensions.get('window').height - 100,
width: Dimensions.get('window').width,
color: '#eaff0a',
height: 100,
})
.drawText(`${name}`, {
x: Dimensions.get('window').width / 2,
y: Dimensions.get('window').height - 16,
fontSize: 16
})
const path = `${dirs.DownloadDir}/SAMPLE.pdf`;
PDFDocument.create(path).addPage(page1).write().then((res) => {
console.log("File saved at: " + res);
})
}
Hi, your library was be useful for my project that i had been working, but when i went to set text from variable, it displayed "undefined ". My code look like 👍
Result:

Thank you for reply