mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
Release v1.8.3: Major UI and Export Enhancements
This release includes significant improvements to PDF Editor UI, enhanced PDF/Word export functionality, print fixes, and configurable template settings. 🎯 v1.8.1 - Streamlined PDF Editor UI: - Clean, focused interface showing only the selected PDF operation - Smooth fade-in animations when switching between functions - Optimized dialog sizing (max-width 600px, max-height 85vh) - Enhanced file list styling with better contrast - Complete dark theme support for all PDF editor components - Better scrolling behavior for long forms 📄 v1.8.2 - Enhanced PDF Export & Print Fix: - New "PDF (Enhanced)" export option using Word template + LibreOffice conversion - Added to both single-file export and batch converter - Keyboard shortcut: Ctrl+Shift+P for enhanced PDF export - Fixed print preview showing blank output issue - Simplified print handler using CSS @media print rules - Better print styling with proper element hiding/showing ⚙️ v1.8.3 - Configurable Template Settings: - Added "Template Settings..." menu option - Configurable start page for Word template content insertion - Choose from Pages 1-5 or custom page number (1-100) - Settings persisted across sessions - Updated WordTemplateExporter to use configurable start page - Works with both DOCX (Enhanced) and PDF (Enhanced) export - Applied to single-file and batch conversion workflows 🔧 Technical Improvements: - Enhanced WordTemplateExporter constructor to accept startPage parameter - Updated insertContentAfterPage method for flexible page insertion - Added Template Settings dialog with quick-select buttons - IPC communication for custom page number input - Settings stored in userData/settings.json - Improved CSS specificity with PDF editor-specific classes - Fixed @media print rules to ensure preview content is visible 🎨 UI/UX Enhancements: - PDF Editor sections now animate smoothly when switching - File lists for merge operations styled with proper contrast - Remove buttons styled with danger color (#dc3545) - Template settings dialog shows current template and start page - All enhancements support all 22 existing themes The application now provides professional-grade PDF editing, enhanced export capabilities with full control over template-based generation, and a streamlined user interface that makes complex operations simple and intuitive. 🤖 Generated with Claude Code
This commit is contained in:
+13
-82
@@ -1184,95 +1184,26 @@ function handlePrintPreview(withStyles) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Store original display values for restoration
|
||||
const elementsToHide = [];
|
||||
console.log('[RENDERER] Starting print with withStyles:', withStyles);
|
||||
console.log('[RENDERER] Preview content length:', previewContent.innerHTML.length);
|
||||
|
||||
// Hide toolbar
|
||||
const toolbar = document.querySelector('.toolbar');
|
||||
if (toolbar) {
|
||||
elementsToHide.push({ elem: toolbar, display: toolbar.style.display });
|
||||
toolbar.style.display = 'none';
|
||||
// Add body classes for print mode - let CSS handle everything
|
||||
document.body.classList.add('printing');
|
||||
if (!withStyles) {
|
||||
document.body.classList.add('printing-no-styles');
|
||||
}
|
||||
|
||||
// Hide tab bar
|
||||
const tabBar = document.querySelector('.tab-bar');
|
||||
if (tabBar) {
|
||||
elementsToHide.push({ elem: tabBar, display: tabBar.style.display });
|
||||
tabBar.style.display = 'none';
|
||||
}
|
||||
|
||||
// Hide status bar
|
||||
const statusBar = document.querySelector('.status-bar');
|
||||
if (statusBar) {
|
||||
elementsToHide.push({ elem: statusBar, display: statusBar.style.display });
|
||||
statusBar.style.display = 'none';
|
||||
}
|
||||
|
||||
// Hide editor pane
|
||||
const editorPane = document.getElementById(`editor-pane-${activeTabId}`);
|
||||
if (editorPane) {
|
||||
elementsToHide.push({ elem: editorPane, display: editorPane.style.display });
|
||||
editorPane.style.display = 'none';
|
||||
}
|
||||
|
||||
// Hide all dialogs
|
||||
const dialogs = document.querySelectorAll('.dialog, .modal-overlay');
|
||||
dialogs.forEach(dialog => {
|
||||
elementsToHide.push({ elem: dialog, display: dialog.style.display });
|
||||
dialog.style.display = 'none';
|
||||
});
|
||||
|
||||
// Make preview pane full width
|
||||
const previewPane = document.getElementById(`preview-pane-${activeTabId}`);
|
||||
let originalPreviewStyles = {};
|
||||
if (previewPane) {
|
||||
originalPreviewStyles = {
|
||||
position: previewPane.style.position,
|
||||
top: previewPane.style.top,
|
||||
left: previewPane.style.left,
|
||||
width: previewPane.style.width,
|
||||
height: previewPane.style.height,
|
||||
margin: previewPane.style.margin,
|
||||
padding: previewPane.style.padding
|
||||
};
|
||||
previewPane.style.position = 'absolute';
|
||||
previewPane.style.top = '0';
|
||||
previewPane.style.left = '0';
|
||||
previewPane.style.width = '100%';
|
||||
previewPane.style.height = 'auto';
|
||||
previewPane.style.margin = '0';
|
||||
previewPane.style.padding = '20px';
|
||||
}
|
||||
|
||||
// Apply no-styles if needed
|
||||
if (!withStyles && previewContent) {
|
||||
previewContent.style.color = '#000';
|
||||
previewContent.style.background = '#fff';
|
||||
}
|
||||
|
||||
// Wait for DOM updates then print
|
||||
// Wait for CSS to apply then print
|
||||
setTimeout(() => {
|
||||
console.log('[RENDERER] Sending do-print to main process');
|
||||
ipcRenderer.send('do-print', { withStyles });
|
||||
|
||||
// Restore everything after print dialog opens
|
||||
// Restore classes after print dialog opens
|
||||
setTimeout(() => {
|
||||
// Restore hidden elements
|
||||
elementsToHide.forEach(({ elem, display }) => {
|
||||
elem.style.display = display;
|
||||
});
|
||||
|
||||
// Restore preview pane styles
|
||||
if (previewPane) {
|
||||
Object.assign(previewPane.style, originalPreviewStyles);
|
||||
}
|
||||
|
||||
// Restore preview content styles
|
||||
if (!withStyles && previewContent) {
|
||||
previewContent.style.color = '';
|
||||
previewContent.style.background = '';
|
||||
}
|
||||
}, 500);
|
||||
}, 200);
|
||||
document.body.classList.remove('printing', 'printing-no-styles');
|
||||
console.log('[RENDERER] Print classes removed');
|
||||
}, 1000);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
// Export Dialog functionality
|
||||
|
||||
Reference in New Issue
Block a user