nativescript-html2pdf
允许轻松将 HTML 转换为 PDF 文件。
npm i --save nativescript-html2pdf

nativescript-html2pdf

允许轻松将 HTML 转换为 PDF 文件。目前仅支持 Android。

安装

tns plugin install nativescript-html2pdf

使用

import { html2PdfFile } from 'nativescript-html2pdf';

let myHtml: string = '<p>Hello World</p>';

let pdfPath: string = 'fs.knownFolders.documents().getFile('myPdf.pdf').path;

html2PdfFile(myHtml, pdfPath);

//Your PDF file is now available at the specified path.