gogo_rulez
gogo_rulez

Reputation: 389

Exporting a div's content to PDF

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!

Upvotes: 4

Views: 16306

Answers (3)

Vahid Taghizadeh
Vahid Taghizadeh

Reputation: 997

You can use these jquery plugins

  1. https://github.com/mozilla/pdf.js

  2. https://github.com/MrRio/jsPDF

Upvotes: 2

Baptiste Donaux
Baptiste Donaux

Reputation: 1310

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.

Upvotes: 0

cluster1
cluster1

Reputation: 5752

Maybe you could combine the PHP-Printer functions-api (http://www.php.net/manual/en/book.printer.php) with a software like, for example, PDF-Creator (http://sourceforge.net/projects/pdfcreator/). But this would imply that PDF-Creator is installed on the system of the user.

It's just a general idea ...

Upvotes: 0

Related Questions