简体   繁体   English

使用现有数据动态生成 PDF 并使用 Vuejs 进行设计

[英]Dynamically generate a PDF using existing data and design using Vuejs

I would like to know if this is possible.我想知道这是否可能。 I am trying to create a form and that takes in name, expiry, picture, and on submit generates a PDF with the details provided.我正在尝试创建一个表单,它包含名称、到期时间、图片,并在提交时生成一个 PDF 并提供详细信息。

The PDF would have an existing design created by me and I want these details to go and update on a specific location on the pdf. PDF 将有一个由我创建的现有设计,我希望将这些详细信息提供给 go 并在 pdf 上的特定位置进行更新。

Is this possible?这可能吗? if so, how do I go about it?如果是这样,我该怎么做 go 呢?

I have been exploring jsPDF and html2pdf...我一直在探索 jsPDF 和 html2pdf ......

You can use vue-html2pdf or jspdf .您可以使用vue-html2pdfjspdf

https://www.npmjs.com/package/vue-html2pdf https://www.npmjs.com/package/vue-html2pdf

https://www.npmjs.com/package/jspdf https://www.npmjs.com/package/jspdf

And it seems you are using Laravel for the backend.看来您正在使用 Laravel 作为后端。 Regardless of whether it is any other language such as Java or Python, it may be another option to generate PDF files on the server side, not the client side.不管是Java还是Python等任何其他语言,在服务器端而不是客户端生成PDF文件可能是另一种选择。

use can use snappyPDF or wkhtmltopdf.使用可以使用 snappyPDF 或 wkhtmltopdf。

https://github.com/barryvdh/laravel-snappy https://github.com/barryvdh/laravel-snappy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM