基于html2canvas和jspdf将document DOM节点转换为图片生成PDF文件,并下载到本地

基于html2canvas和jspdf将document DOM节点转换为图片生成PDF文件,并下载到本地_第1张图片


这里要用到html2canvas将document DOM节点转换为图片,并下载到本地_你挚爱的强哥的博客-CSDN博客前端用原生js编辑文件内容→创建生成文件(格式可以自定义)→下载文件_你挚爱的强哥的博客-CSDN博客。会自动创建一个html文件。https://blog.csdn.net/qq_37860634/article/details/131752136

jspdf插件的官网和GitHub了解下 

jsPDFGenerate professional PDFs easily with jsPDF, the open-source solution for PDF generation. Create event tickets, reports, certificates, and more in minutes with our intuitive interface.https://parall.ax/products/jspdfGitHub - parallax/jsPDF: Client-side JavaScript PDF generation for everyone.Client-side JavaScript PDF generation for everyone. - GitHub - parallax/jsPDF: Client-side JavaScript PDF generation for everyone.https://github.com/parallax/jsPDF安装先

npm install jspdf --save

引用 

import { jsPDF } from "jspdf";

 用例代码


你可能感兴趣的:(Vue.js,pdf)