html to pdf download working

PHOTO EMBED

Tue Aug 01 2023 16:01:12 GMT+0000 (Coordinated Universal Time)

Saved by @pradhyumnsoni #database #postgresql #nodejs #indiafirst #javascript #pgadmin4

import { jsPDF } from "jspdf";

export default async function lead({
}) {

  const doc = new jsPDF('p', 'pt', 'a4');
  doc.setFontSize(12)
  doc.html(document.getElementById("dream-house-full"),  {
    useCORS: true,
    autoPaging:'text',
    // html2canvas:
    callback: function (pdf) {
      pdf.save("12.pdf");
    },
    html2canvas: {
      scale: 0.5,
      // ignoreElements: element => element.id === autoTableConfig?.elementId,
    },
    x:10,
    y:10,
    width:1400,
  });
  // doc.save("a4.pdf");

  // htmlPdf.create(html, options).then((pdf) => pdf.toFile('test.png'));
}
content_copyCOPY

Using jspdf npm package https://www.npmjs.com/package/jspdf