Hi so I created a function using html2pdf, it works fine pdf is generated and can download it with no problem, but now I want the function to open the file directly instead of opening the browser pop up to open/save file
function looks like this:
const download = () => {
const element = document.getElementById("element-to-print");
const opt = {
filename: patientName + "_Report.pdf",
image: { type: "jpeg", quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: "in", format: "a4", orientation: "landscape" },
};
// New Promise-based usage:
html2pdf().set(opt).from(element).save();
};
}, []);



