npm i --save nativescript-html2pdf
- 版本:2.0.0
- GitHub: https://github.com/radu2501/nativescript-html2pdf
- NPM: https://npmjs.net.cn/package/nativescript-html2pdf
- 下载
- 昨天: 0
- 上周: 0
- 上个月: 0
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.