This Python script allows you to convert each column in an Excel spreadsheet into its own centered, formatted PDF. Each column becomes a multi-page PDF, with each cell’s content centered on a separate page.
Perfect for generating print-ready PDFs from structured column data — such as flashcards, name tags, or individual labels.
- 📊 Converts every non-empty column into its own PDF
- 🧾 Each cell appears on its own page, centered and auto-sized
- 💡 Dynamically adjusts font size to fit content
- 🗂️ Automatically names output files using Excel-style column letters (
A,B, ...,AA, etc.) - 📁 Saves all output to your
~/Downloads/outputs/directory - 🖱️ Uses a file picker dialog for user-friendly Excel file selection
- 🧪 Built with Pandas, ReportLab, and Tkinter
This project uses uv for dependency and environment management.
curl -LsSf https://astral.sh/uv/install.sh | shuv venv
uv pip install -r requirements.txtIf you don't have a
requirements.txt, use:
uv pip install pandas reportlabRun the script:
uv venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
python your_script.py- A file dialog will appear — select your Excel file.
- PDFs will be generated in:
~/Downloads/outputs/
If your Excel file is named Students.xlsx with data in columns A and B, the script will generate:
~/Downloads/outputs/
├── Students_Column_A.pdf
└── Students_Column_B.pdf
Each PDF contains one page per cell entry.
- Reads the Excel file without a header.
- Iterates over each column.
- Skips columns that are entirely blank or empty.
- For each cell:
- Formats date cells as
MM/DD. - Splits long text to fit the page.
- Adjusts font size to avoid overflow.
- Formats date cells as
- Outputs a single-page-per-cell PDF, with text centered vertically and horizontally.
pandasreportlabtkinter(usually comes preinstalled with Python)uv(for virtual environment and dependency management)
- Only
.xlsand.xlsxfiles are supported. - Output folder is hardcoded to
~/Downloads/outputs/. - Text wrapping is basic — for more complex formatting, the script can be extended.