📅  最后修改于: 2022-03-11 15:01:15.800000             🧑  作者: Mango
import React, { Component } from 'react';
import {
Text,
TouchableHighlight,
View,
} from 'react-native';
import RNHTMLtoPDF from 'react-native-html-to-pdf';
export default class Example extends Component {
async createPDF() {
let options = {
html: 'PDF TEST
',
fileName: 'test',
directory: 'Documents',
};
let file = await RNHTMLtoPDF.convert(options)
// console.log(file.filePath);
alert(file.filePath);
}
render() {
return(
Create PDF
)
}
}