简体   繁体   English

提交表单后如何生成PDF文件?

[英]How can I generate a PDF file after i submit a form?

I'm not using node js or some front-end framework, I work now in plain html and js, and I got a form, i want to simplify my work, I have to create 500 pdf files as some reports for my business and I created a form and every time I click the submit button I want to autogenerate that pdf and download it to my computer.我没有使用 node js 或一些前端框架,我现在使用纯 html 和 js,我得到了一个表单,我想简化我的工作,我必须创建 500 个 pdf 文件作为我的业务报告和我创建了一个表单,每次单击提交按钮时,我都想自动生成该 pdf 并将其下载到我的计算机上。 I have the html template on how I want my pdf too look like, but I can't find something on Google on how I parse the form data to that page and make it downloadable as PDF, can you please help me?我有关于我希望我的 pdf 看起来如何的 html 模板,但我无法在 Google 上找到有关如何将表单数据解析到该页面并使其可下载为 PDF 的内容,你能帮我吗? Is there a solution or I must use a front-end framework有没有解决方案或者我必须使用前端框架

Sorry it doesn't look like I can comment yet (new user).抱歉,我似乎还不能发表评论(新用户)。 I'm not sure how to solve your specific problem, but if all else fails you can try to print it and when you get shown the print screen, select "Save as PDF" instead of a printer.我不确定如何解决您的具体问题,但如果所有其他方法都失败了,您可以尝试打印它,当您看到打印屏幕时,选择“另存为 PDF”而不是打印机。 I'm also a little confused on that you mean by a form.我也有点困惑你的意思是表格。 What kind of data is it?它是什么样的数据? Tables?桌子? Values?价值观? Personal information?个人信息? Does it need to be downloadable as soon as you hit submit?是否需要在您点击提交后立即下载? Do you want to print it the same way some companies will offer you the option to print a receipt after purchasing something?您是否想像某些公司为您提供在购买商品后打印收据的选项一样打印它? Please explain your problem a little more so we can help you :)请多解释一下您的问题,以便我们为您提供帮助:)

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

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