BLACKSITE
:
216.73.216.21
:
178.16.136.184 / www.jsdp.in
:
Linux in-mum-web1273.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
:
/
home
/
u759409306
/
public_html
/
js
/
Upload File:
files >> /home/u759409306/public_html/js/pdf.js
window.onload = function () { document.getElementById("download") .addEventListener("click", () => { const invoice = document.getElementById("invoice"); console.log(invoice); console.log(window); var opt = { margin: 1, filename: 'JSDP ID-Card.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' } }; html2pdf() .from(invoice) .set(opt) .save() .then(() => { window.open(pdfURL, '_blank'); }); const { jsPDF } = window.jspdf; const doc = new jsPDF(); // Get the content you want to add to the PDF const name = "<?php echo htmlspecialchars($row['name']); ?>"; const id = "<?php echo htmlspecialchars($row['id']); ?>"; const contact = "<?php echo htmlspecialchars($row['contact']); ?>"; const date = "<?php echo htmlspecialchars($row['date']); ?>"; const address = "<?php echo htmlspecialchars($row['address']); ?>"; // Starting positions for static information doc.text(`Name: ${name}`, 10, 20); doc.text(`Id: ${id}`, 10, 30); doc.text(`Contact: ${contact}`, 10, 40); doc.text(`Date: ${date}`, 10, 50); doc.text(`Address: ${address}`, 10, 60); // Save the PDF // Generate the PDF and open it in a new tab const pdfOutput = doc.output('blob'); // Generate the PDF as a blob const pdfURL = URL.createObjectURL(pdfOutput); // Create a URL for the blob // Open the PDF in a new tab window.open(pdfURL, '_blank'); }); }