forked from colin/resume
2
0
Fork 0
lucky-ddg/docker/resume/pdf-download.js

22 lines
811 B
JavaScript

document.addEventListener('DOMContentLoaded', function() {
const downloadButton = document.getElementById('downloadPDF');
if (downloadButton) {
downloadButton.addEventListener('click', function() {
// Store current theme
const currentTheme = document.body.getAttribute('data-theme');
// Force light theme for PDF
document.body.setAttribute('data-theme', 'light');
// Wait for theme change to apply
setTimeout(function() {
window.print();
// Restore original theme
setTimeout(function() {
document.body.setAttribute('data-theme', currentTheme);
}, 100);
}, 100);
});
}
});