I know that there are a number of points regarding this question, but I just can't find what I'm looking for so I hope someone can answer me. So, what I'm trying to do is:
imagine you have a div that is 400 X 400 px. The user uploads an image and enters text via input[type="text"] and all of it is shown inside that div. I want to export all of the content of that div in a PDF, possibliy by JavaScript (jQuery) od PHP. What would be the best way to do it?
If anyone could show a small example (code), I would appreciate it!
I know that there are a number of points regarding this question, but I just can't find what I'm looking for so I hope someone can answer me. So, what I'm trying to do is:
imagine you have a div that is 400 X 400 px. The user uploads an image and enters text via input[type="text"] and all of it is shown inside that div. I want to export all of the content of that div in a PDF, possibliy by JavaScript (jQuery) od PHP. What would be the best way to do it?
If anyone could show a small example (code), I would appreciate it!
Share Improve this question edited Jun 25, 2017 at 11:15 ROMANIA_engineer 56.8k30 gold badges209 silver badges205 bronze badges asked Feb 16, 2014 at 9:09 gogo_rulezgogo_rulez 3892 gold badges11 silver badges25 bronze badges3 Answers
Reset to default 2You can use these jquery plugins
https://github./mozilla/pdf.js
https://github./MrRio/jsPDF
Maybe you could bine the PHP-Printer functions-api (http://www.php/manual/en/book.printer.php) with a software like, for example, PDF-Creator (http://sourceforge/projects/pdfcreator/). But this would imply that PDF-Creator is installed on the system of the user.
It's just a general idea ...
You can generate a PDF since a HTML page, with the WeasyPrint package. It's very easy to use and its most speed that javascript.