Resume Banaye
ईमेल: ${email}
`; if (phone) html += `फोन: ${phone}
`; if (address) html += `पता: ${address}
🎯 करियर ऑब्जेक्टिव
${objective}
`; if (education) html += `🎓 शिक्षा
- ${education.split('\n').map(line => `
- ${line} `).join('')}
💼 अनुभव
- ${experience.split('\n').map(line => `
- ${line} `).join('')}
🛠️ कौशल
- ${skills.split('\n').map(line => `
- ${line} `).join('')}
📌 व्यक्तिगत जानकारी
`;
if (p_name) html += `
`;
if (p_language) html += `
`;
html += `नाम: ${p_name}
`; if (p_father) html += `पिता का नाम: ${p_father}
`; if (p_dob) html += `जन्म तिथि: ${p_dob}
भाषा ज्ञान: ${p_language}
`; if (p_gender) html += `लिंग: ${p_gender}
`; if (p_marital) html += `वैवाहिक स्थिति: ${p_marital}
`; if (p_nationality) html += `राष्ट्रीयता: ${p_nationality}
`; html += ``;
html += `
`;
html += `
`;const preview = document.getElementById('cvwp9-preview');
preview.innerHTML = html;
document.getElementById('cvwp9-output').style.display = 'block';
console.log('Preview generated');// Make editable fields functional
document.querySelectorAll('.cvwp9-editable').forEach(field => {
field.addEventListener('focus', () => {
console.log('Editable field focused:', field.textContent);
field.style.border = '1px solid #007BFF';
});
field.addEventListener('blur', () => {
console.log('Editable field blurred:', field.textContent);
field.style.border = 'none';
});
field.addEventListener('keydown', (e) => {
if (e.key === ' ' || e.keyCode === 32) {
e.preventDefault();
field.textContent += ' ';
console.log('Spacebar pressed, added space');
}
});
});
}if (photoInput.files && photoInput.files[0]) {
const reader = new FileReader();
reader.onload = function(e) {
const imageHTML = ``;
buildPreview(imageHTML);
console.log('Photo loaded:', e.target.result);
};
reader.onerror = function(e) {
console.error('Photo load error:', e);
alert('फोटो लोड करने में त्रुटि। फोटो के बिना CV बनाएं।');
buildPreview('');
};
reader.readAsDataURL(photoInput.files[0]);
} else {
buildPreview('');
}
} catch (err) {
console.error('Error generating CV:', err);
alert('CV जनरेट करने में त्रुटि। कृपया कंसोल देखें।');
}
};// Print CV function
window.cvwp9PrintCV = function() {
console.log('Print CV clicked');
try {
const preview = document.getElementById('cvwp9-preview');
if (!preview.innerHTML) {
console.error('Preview is empty');
alert('CV प्रीव्यू खाली है। पहले CV बनाएं।');
return;
}// Fallback: Create a temporary container for printing only the preview
const printContainer = document.createElement('div');
printContainer.style.position = 'absolute';
printContainer.style.top = '-9999px';
printContainer.style.width = '100%';
printContainer.style.fontFamily = "'Noto Sans Devanagari', Arial, sans-serif";
printContainer.innerHTML = preview.innerHTML;
document.body.appendChild(printContainer);// Print the temporary container
window.print();// Clean up
document.body.removeChild(printContainer);
} catch (err) {
console.error('Error printing CV:', err);
alert('CV प्रिंट करने में त्रुटि: ' + err.message);
}
};
});
दिनांक: ${p_date}
स्थान: ${p_place}
${name || 'हस्ताक्षर'}
`;
html += `