Reputation: 21
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
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