HTML5 Zone is brought to you in partnership with:

Paulund is a website dedicated to writing tutorials and code snippets about Web Development, the main subjects are PHP, Wordpress, jQuery, CSS3 and HTML5. Paul is a DZone MVB and is not an employee of DZone and has posted 131 posts at DZone. You can read more from them at their website. View Full User Profile

jsPDF: an HTML5 Solution to Creating PDFs

09.18.2013
| 8615 views |
  • submit to reddit

jsPDF - HTML5 PDF Generator - Parallax

Normally, if you wanted to programmatically create PDFs, you would have to use a server side client, such as PDFLib, FPDF, TCPDF, DomPDF.

Here is an HTML5 client-side solution to creating PDFs called jsPDF.

It comes with a number of features, including:

  • Add images.
  • Add different font faces and change font sizes.
  • Convert HTML to PDF.
  • Add multiple pages.
  • Draw shapes.
  • Convert page layout from portrait to landscape.
  • Split strings to fit text on the page.

Browser Support

Because this uses a Javascript library, it is compatible with all major browsers, including IE6+, Firefox 3+, Chrome 3+, Safari 3+ and Opera.

Try it out on your next project: jsPDF

Published at DZone with permission of Paul Underwood, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)