【发布时间】:2020-03-20 16:54:27
【问题描述】:
我正在尝试从用户那里获取输入,然后将其保存为 pdf 文件,但在示例中没有显示如何在 pdf 中添加动态值的任何方法 这是一个例子
async createPDF() {
let options = {
html: '<h1>PDF TEST</h1>',
fileName: 'test',
directory: 'Documents',
};
let file = await RNHTMLtoPDF.convert(options)
// console.log(file.filePath);
alert(file.filePath);
}
我正在尝试做这样的事情
async createPDF() {
let options = {
html: '<h1>PDF {this.state.value}</h1>',
fileName: 'test',
directory: 'Documents',
};
let file = await RNHTMLtoPDF.convert(options)
// console.log(file.filePath);
alert(file.filePath);
}
【问题讨论】:
标签: reactjs react-native npm html-to-pdf