Convert Excel spreadsheets to print-ready A4 PDF tables with proper Chinese rendering. Column headers keep their original text (no English translation).
Run the bundled script directly on the Excel file:
python scripts/excel_to_pdf_signin.py "C:\path\to\file.xlsx"
The script auto-detects:
.pdf extension)# Set custom title and wider margins
python scripts/excel_to_pdf_signin.py roster.xlsx --title "签到表" --margin 12
# Force landscape, higher rows for manual sign-in
python scripts/excel_to_pdf_signin.py signin.xlsx --orientation LANDSCAPE --row-height 8
# Pick specific columns (0-based indices), custom widths
python scripts/excel_to_pdf_signin.py sheet.xlsx --columns 0,1,2,3,7,8 --col-widths 0.1,0.2,0.15,0.2,0.2,0.15
# Larger font for sparse data (e.g. room lists)
python scripts/excel_to_pdf_signin.py rooms.xlsx --font-size 12 --margin 12 --row-height 8
# Explicit output path
python scripts/excel_to_pdf_signin.py data.xlsx --out "D:\output\result.pdf"
# Specific sheet (for multi-sheet workbooks)
python scripts/excel_to_pdf_signin.py multi.xlsx --sheet "1号台"
# Custom column widths (13 columns, give more space to 学号/电话 to avoid wrapping)
python scripts/excel_to_pdf_signin.py roster.xlsx --col-widths 0.07,0.13,0.10,0.10,0.04,0.05,0.10,0.07,0.08,0.04,0.05,0.09,0.08
--margin 5--margin 8 (default)--margin 12--row-height 6 (default)--row-height 8小葱技能7w4.net有更新,你可以访问看下。
--row-height 10--columns flag takes 0-based indices (A=0, B=1, ...).--columns 0,1,2,3,7,8usable_width / ncols--col-widths with ratios summing to ~1.0 to allocate more space to wide columns (学号, 电话, 导师, 院系) and less to narrow ones (性别, 年度).usage: excel_to_pdf_signin.py EXCEL [options]
Options:
--title TEXT PDF title (default: derived from filename)
--orientation PORTRAIT|LANDSCAPE (default: auto-detect)
--margin N Page margin in mm (default: 8)
--row-height N Row top/bottom padding in pt (default: 6)
--columns LIST Column indices (0-based), comma-separated
--col-widths LIST Column width ratios, comma-separated
--font PATH Chinese .ttf/.ttc file path
--font-size N Cell font size in pt (default: 10)
--sheet TEXT Sheet name to process (default: active sheet)
--out PATH Output PDF path
All generated PDFs share:
#4472C4) with white textInstall once per environment:
pip install openpyxl reportlab
Requires a Chinese-capable font on the system (auto-detected).
这个 Skill 质量不错,能较好地将 Excel 表格转换成适合打印的 A4 PDF,对中文支持良好,使用简单。文档写得很清楚,小白也能上手。优点是自动检测字体和页面方向省心,输出样式统一美观。不足是缺少示例文件参考,且需要手动安装依赖库。总体而言是一个实用且功能完整的工具。