Rendering PDF files in the browser with JS

There are 2 ways of rendering PDFs for your website or application. The first way is the server-side rendering, which is probably the most well known in the web development world. There are a lot of articles how to implement it and which library to use, that’s why we skip it and focus on a new way, the client-side rendering which starts being popular with the advancement of HTML5.

Why Should You Prefer the Client-side Rendering

There is a couple of reasons. Firstly, you can save server’s CPU resources, so they can be used for something more valuable. Secondly, you don’t need to worry where to store thousands of generated PDFs as well as cleaning up the old ones.

Libraries

Thanks to the open source community, there are a lot of good libraries to solve this problem. In this post I will highlight two the most promising ones:  jsPDF and  PDFMake.

#pdf #pdfmake #jspdf #javascript #html

Rendering PDF files in the browser with JavaScript
2.95 GEEK