verrwirung
verrwirung

Reputation: 21

display <div> content to PDF

Is there any way that I can create a button to display specific div/s in a pdf format using only javascript? I've heard of pdf converters like mpdf, but I'm not really allowed to install or make any changes on the server. is this possible only by using javascript? thanks!

Upvotes: 0

Views: 1668

Answers (1)

Rumen Jekov
Rumen Jekov

Reputation: 1675

You can use the PDF.JS or the jsPDf JavaScript based libraries to export the contents of a DIV to PDF file entirely on the client side.

Here are links with more information: http://mozilla.github.io/pdf.js/ http://parall.ax/products/jspdf

Here is a demo with a element: Cannot make PDF from Html div by jsPDF

Upvotes: 2

Related Questions