📜  React Native pdf 创建器 html-to-pdf - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:15.800000             🧑  作者: Mango

代码示例1
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 ) } }