HTML CSS

CONVERT HTML TO PDF IN JAVASCRIPT

DOWNLOAD FROM GITHUB https://ekoopmans.github.io/html2pdf.js/

HTML2PDF LIBRARY

01

OR LOAD FROM CDNJS https://cdnjs.com/libraries/html2pdf.js

html2pdf()   SET OPTIONS   .set({     margin: 1, filename: "demo.pdf",     image: { type: "jpeg", quality: 0.8 },     jsPDF: { format: "A4", orientation:      "landscape" }   })

CONVERT HTML TO PDF

02

  PASS IN ENTIRE PAGE      .from(document.body)   OR JUST A SECTION   .from(document.getElementById("ID"))   SAVE TO PDF FILE   .save();