This article explains how to create PDF from HTML using JSPDF.
Voice of a Developer: JavaScript From Scratch