Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 1.83 KB

File metadata and controls

55 lines (45 loc) · 1.83 KB

HTML to PDF Converter

Overview

A Python application that converts HTML files in a directory to PDF format using WeasyPrint. Available in both GUI and CLI versions.

Purpose

This tool allows users to batch convert HTML files to professional-quality PDFs using either a graphical interface or command-line.

Current State

  • Fully functional GUI and CLI implementations
  • Tkinter-based graphical interface with directory pickers
  • Command-line interface for automation
  • Support for .html and .htm file extensions
  • Real-time progress tracking and error handling

Recent Changes

  • 2025-10-09: GUI implementation

    • Added Tkinter-based graphical interface (html2pdf_gui.py)
    • Directory selection dialogs for input/output
    • Real-time status updates with color-coded messages
    • Threading for responsive UI during conversion
    • Updated workflow to launch GUI application
  • 2025-10-09: Initial project setup

    • Installed Python 3.11 and WeasyPrint
    • Created main conversion script (html2pdf.py)
    • Added command-line argument parsing
    • Implemented batch conversion with progress reporting

Project Architecture

  • html2pdf_gui.py: GUI application (primary interface)

    • Tkinter-based graphical interface
    • Directory picker dialogs
    • Real-time status updates with threading
    • Color-coded logging (success/error/info/summary)
    • Responsive UI during conversions
  • html2pdf.py: CLI version

    • Command-line interface using argparse
    • Directory scanning for HTML files
    • Individual file conversion using WeasyPrint
    • Error handling and progress reporting

Dependencies

  • Python 3.11
  • WeasyPrint 66.0 (HTML to PDF conversion engine)
  • Supporting libraries: Pillow, fonttools, cssselect2, tinycss2

Usage

python html2pdf.py <input_directory> [-o <output_directory>]

User Preferences

None specified yet.