如何将HTML表单数据输出到PDF? [英] How do I output HTML form data to PDF?

查看:86
本文介绍了如何将HTML表单数据输出到PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以HTML格式从访问者那里收集数据,然后让他们打印预先填充了适当字段的文档.他们需要在文档上有几个签名,因此必须将其打印出来.

I need to collect data from a visitor in an HTML form and then have them print a document with the appropriate fields pre-populated. They'll need to have a couple of signatures on the document, so it has to be printed.

纸质表格已经存在,因此一个想法是将其扫描成图像,但不填充任何内容.然后,我将使用CSS来打印HTML表单数据,以便定位并使用空白的扫描表单作为背景图像.

The paper form already exists, so one idea was to scan it in, with nothing filled out, as an image. I would then have the HTML form data print out using CSS for positioning and using the blank scanned form as a background image.

我认为,更好的选择是使用此数据自动生成PDF,但我不确定如何完成.

A better option, I would think, would be to automatically generate the PDF with this data, but I'm not sure how to accomplish either.

建议和想法将不胜感激!=)

Suggestions and ideas would be greatly appreciated! =)

推荐答案

我不得不尊重奥斯瓦尔多的观点.在跨浏览器集成方面,使用CSS在打印的文档上对齐将需要很长时间才能有效地完成.另外,如果Microsoft推出了新的浏览器,则您将不得不不断更新以在浏览器中使用新的功能.

I would have to respectfully disagree with Osvaldo. Using CSS to align on a printed document would take ages to do efficiently in the aspect of cross-browser integration. Plus, if Microsoft comes out with a new browser, you're going to have to constantly update for the new use in browsers.

如果您了解任何PHP(其中,如果您了解JavaScript和HTML,则基本的PHP非常简单),这是一个可以使用的好库,

If you know any PHP (Which, if you know JavaScript and HTML, basic PHP is very simple), here's a good library you can use, FDPF:

值得庆幸的是,PHP并不会弃用很多方法,而且如果您必须进行更改的话,总代码少于10行.

Thankfully, PHP doesn't deprecate a whole lot of methods and the total code is less than 10 lines if you have to go in and change things around.

这篇关于如何将HTML表单数据输出到PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆