admin管理员组文章数量:1332345
Tricky question.
I have a very long form where the user writes down a lot of data. I need to save the form for future reading (pdf, html, or even a jpg will do), but I need to save it with the data that the user wrote down. This has to be done on submitting the form.
I know it's going to be impossible with only PHP, but would it be possible with a little help from javascript-ajax?
I can't prompt the user to print the page, and I need to save the view without any other input from the user (beside the submit).
Any ideas?
EDIT:
in a nutshell,
is it possible to generate a pdf from that page without submitting the data ? is there a way fpdf (or others) could "read" and save what's currently on the screen, just like a "print" function ?
imagine a long, looong form, with a button "save as pdf" who saves the current page (with the data inputted from the user) WITHOUT submitting the form....
Tricky question.
I have a very long form where the user writes down a lot of data. I need to save the form for future reading (pdf, html, or even a jpg will do), but I need to save it with the data that the user wrote down. This has to be done on submitting the form.
I know it's going to be impossible with only PHP, but would it be possible with a little help from javascript-ajax?
I can't prompt the user to print the page, and I need to save the view without any other input from the user (beside the submit).
Any ideas?
EDIT:
in a nutshell,
is it possible to generate a pdf from that page without submitting the data ? is there a way fpdf (or others) could "read" and save what's currently on the screen, just like a "print" function ?
imagine a long, looong form, with a button "save as pdf" who saves the current page (with the data inputted from the user) WITHOUT submitting the form....
Share Improve this question edited Feb 7, 2011 at 8:15 NicolaPasqui asked Feb 3, 2011 at 16:52 NicolaPasquiNicolaPasqui 1,1201 gold badge8 silver badges17 bronze badges 1- stackoverflow./questions/1648715/… something to read while you wait for other ments. – phill Commented Feb 3, 2011 at 16:56
3 Answers
Reset to default 1Take a look at the thread: Which is the best PDF library for PHP?
Highested listed solutions include:
- TCPDF
- FPDF
Another possible solution would be converting HTML to PDF in PHP: HTML to PDF in PHP
You can have a look at: http://php/manual/en/book.pdf.php and this http://www.tcpdf/
Hope this helps you.. Thanks
If you want to go from form data to PDF then one of the methods you could try is to take the submitted data, create a HTML document, and convert that document to PDF. You wouldn't necessarily need to send the HTML to the user (though you could) because you'd be using the HTML merely for formatting purposes. Push the HTML into a variable and then parse it through one of the many HTML to PDF converters.
本文标签: phpSave form results as PDFStack Overflow
版权声明:本文标题:php - Save form results as PDF - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742325980a2453732.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论