Press Kit Content Generator

Press Kit Content Generator

Fill in the details below to generate your professional press kit content.

${prBoilerplate.replace(/\n/g, '
')}

`; if(prContact) html += `

Media Contact:

${prContact.replace(/\n/g, '
')}

`; } pdfOutput.innerHTML = html || '

No content was generated. Please fill out the fields in the previous tabs.

'; downloadPdfBtn.classList.remove('hidden'); }; /** * Downloads the generated content as a professionally formatted PDF file. * This version builds the PDF from text, ensuring proper wrapping and small file size. */ const downloadPDF = () => { const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); // --- PDF Styling and Configuration --- const page_width = pdf.internal.pageSize.getWidth(); const margin = 40; const max_width = page_width - margin * 2; let y = margin; // Vertical cursor // --- Helper Functions --- const checkPageBreak = (spaceNeeded) => { if (y + spaceNeeded > pdf.internal.pageSize.getHeight() - margin) { pdf.addPage(); y = margin; } }; const addTitle = (text) => { checkPageBreak(50); pdf.setFontSize(22); pdf.setFont("helvetica", "bold"); pdf.setTextColor(31, 41, 55); // gray-800 pdf.text(text, page_width / 2, y, { align: 'center' }); y += 30; } const addSectionHeader = (text) => { checkPageBreak(40); y += 20; // Space before header pdf.setFontSize(16); pdf.setFont("helvetica", "bold"); pdf.setTextColor(55, 65, 81); // gray-700 pdf.text(text, margin, y); y += 10; pdf.setDrawColor(229, 231, 235); // gray-200 pdf.line(margin, y, page_width - margin, y); y += 20; }; const addSubHeader = (text) => { checkPageBreak(30); pdf.setFontSize(12); pdf.setFont("helvetica", "bold"); pdf.setTextColor(75, 85, 99); // gray-600 pdf.text(text, margin, y); y += 18; }; const addParagraph = (text, options = {}) => { pdf.setFontSize(11); pdf.setFont("helvetica", options.style || "normal"); pdf.setTextColor(107, 114, 128); // gray-500 // Replace
with newlines for jspdf const processedText = text.replace(//gi, '\n'); const lines = pdf.splitTextToSize(processedText, max_width); checkPageBreak(lines.length * 12); pdf.text(lines, margin, y); y += lines.length * 12 + (options.spacing || 10); }; // --- PDF Content Generation --- const companyName = getValue('companyName') || "Press Kit"; addTitle(companyName); // Section 1: Overview addSectionHeader("Company Overview"); const tagline = getValue('tagline'); if(tagline) addParagraph(`Tagline: ${tagline}`, {style: 'italic'}); const website = getValue('website'); if(website) addParagraph(`Website: ${website}`); const mission = getValue('missionStatement'); if(mission) addParagraph(mission); // Section 2: Product/Service const productName = getValue('productName'); if (productName) { addSectionHeader("Product / Service Details"); addSubHeader(productName); const productDesc = getValue('productDescription'); if(productDesc) addParagraph(productDesc); const features = getValue('keyFeatures'); if(features) { addSubHeader("Key Features:"); addParagraph(features); } const audience = getValue('targetAudience'); if(audience) { addSubHeader("Target Audience:"); addParagraph(audience); } const pricing = getValue('pricing'); if(pricing) { addSubHeader("Pricing:"); addParagraph(pricing); } } // Section 3: Biographies const bioBlocks = biosContainer.querySelectorAll('[id^="bio-block-"]'); if (bioBlocks.length > 0 && bioBlocks[0].querySelector('.bio-name').value.trim()) { addSectionHeader("Founder / Team Biographies"); bioBlocks.forEach(block => { const name = block.querySelector('.bio-name').value.trim(); const title = block.querySelector('.bio-title').value.trim(); const text = block.querySelector('.bio-text').value.trim(); if (name && title && text) { checkPageBreak(80); addSubHeader(name); addParagraph(title, {style: 'italic', spacing: 2}); addParagraph(text); y += 10; // Extra space between bios } }); } // Section 4: Press Release const prHeadline = getValue('prHeadline'); if(prHeadline) { addSectionHeader("Sample Press Release"); addSubHeader(prHeadline); const prSubheadline = getValue('prSubheadline'); if(prSubheadline) addParagraph(prSubheadline, {style: 'italic'}); const prDateline = getValue('prDateline'); const prIntro = getValue('prIntro'); if(prDateline && prIntro) addParagraph(`${prDateline} — ${prIntro}`); else if (prIntro) addParagraph(prIntro); const prBody = getValue('prBody'); if(prBody) addParagraph(prBody); const prBoilerplate = getValue('prBoilerplate'); if(prBoilerplate) { addSubHeader(`About ${getValue('companyName') || 'the Company'}`); addParagraph(prBoilerplate); } const prContact = getValue('prContact'); if(prContact) { addSubHeader("Media Contact:"); addParagraph(prContact); } } // --- Save the PDF --- pdf.save(`${companyName.replace(/ /g, '_')}_Press_Kit.pdf`); }; // --- EVENT LISTENERS --- // Tab button clicks tabButtons.forEach((button, index) => { button.addEventListener('click', () => showTab(index)); }); // "Previous" button prevBtn.addEventListener('click', () => { if (currentTab > 0) { showTab(currentTab - 1); } }); // "Next" button nextBtn.addEventListener('click', () => { if (currentTab < tabButtons.length - 1) { showTab(currentTab + 1); } }); // "Add Bio" button addBioBtn.addEventListener('click', addBio); // "Generate Kit" button generateKitBtn.addEventListener('click', generatePressKit); // "Download PDF" button downloadPdfBtn.addEventListener('click', downloadPDF); // --- INITIALIZATION --- addBio(); // Start with one bio block by default updateTabs(); // Set the initial state of tabs and buttons });
Scroll to Top