Free Advanced Online Notepad – Premium Text Editor | VectraTools `;
const blob = new Blob([fullHTML], { type: "text/html;charset=utf-8" });
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = "VectraPad_Notes.html";
a.click();
}// Export PDF (Using html2pdf)
function downloadPDF() {
if (quill.getText().trim().length === 0) return alert("Notepad is empty.");
// Target the editor content area
const element = document.querySelector('.ql-editor');
// Define PDF options
const opt = {
margin: 0.5,
filename: 'VectraPad_Document.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};// Add a temporary class to ensure dark mode text is readable in PDF
const originalColor = element.style.color;
element.style.color = "#000000";
html2pdf().set(opt).from(element).save().then(() => {
element.style.color = originalColor; // Revert color
});
}