Showing posts with label Text To Pdf. Show all posts
Showing posts with label Text To Pdf. Show all posts

Monday 20 May 2024

Text To Pdf Converter



Text to PDF Converter

Text to PDF Converter

body { font-family: Arial, sans-serif; background-color: #f0f8ff; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .container { text-align: center; background: linear-gradient(135deg, #ffcc33 0%, #ff6666 100%); border-radius: 15px; padding: 30px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); width: 80%; max-width: 600px; } h1 { color: #ffffff; margin-bottom: 20px; font-size: 2em; } textarea { width: 100%; height: 150px; border: 2px solid #ffcc33; border-radius: 10px; padding: 10px; font-size: 1em; resize: none; } button { background-color: #ff6666; color: white; border: none; border-radius: 10px; padding: 10px 20px; font-size: 1em; cursor: pointer; transition: background-color 0.3s; } button:hover { background-color: #ff4444; } document.getElementById('convertBtn').addEventListener('click', () => { const text = document.getElementById('textInput').value; if (text.trim() === '') { alert('Please enter some text to convert.'); return; } const doc = new jsPDF(); const lines = doc.splitTextToSize(text, 180); doc.text(lines, 10, 10); doc.save('document.pdf'); }); // Load jsPDF library dynamically const script = document.createElement('script'); script.src = "https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"; script.onload = () => { window.jsPDF = window.jspdf.jsPDF; }; document.head.appendChild(script);

Featured post

  Nestled amidst the icy lakes and vibrant spirit of Minnesota lies a basketball franchise with a story unlike any other. The Minnesota Timb...