Skip to content

About

A desktop tool based on Python + Tkinter: drag in multiple PDF / image files, reorder them, and merge them into a single PDF.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

English

✨ Features

  • 🖱 Add PDF / image files by drag-and-drop or click
  • 🔀 Reorder files with up / down buttons
  • 🔗 Merge everything into a single PDF
  • 🖼 Supports PDF, PNG, JPG, JPEG, BMP, TIFF, GIF, WEBP
  • 📏 Estimates output size and total pages before merging
  • 🪶 Lossless PDF page copy — output size ≈ sum of inputs (no rasterization bloat)
  • 🖍 Keeps the visual "proof stamp" of digital signatures (baked into page content, while the signature validation itself is dropped)

🛠 Requirements

⚠️ Please use Python 3.12 (or 3.10/3.11). Python 3.13/3.14 bundles Tcl/Tk 9.x, which is incompatible with the tkinterdnd2 drag-and-drop extension and causes this extension is compiled for Tcl 8.x.

  • Windows
  • Python 3.12

📦 Install

python -m venv venv
venv\Scripts\python -m pip install -r requirements.txt

🚀 Run

venv\Scripts\python pdf_merger_gui.py

📐 Build exe

venv\Scripts\python build_exe.py

Output: dist\PDF合并工具.exe

To regenerate the icon:

venv\Scripts\python make_icon.py

🗂 Project Structure

pdf_parser/
├── pdf_merger_gui.py   # GUI (entry point)
├── pdf_processor.py    # Core processing logic
├── build_exe.py        # PyInstaller build script
├── make_icon.py        # Generate icon.ico
├── requirements.txt    # Dependencies
└── icon.ico            # App icon

🔍 How it works

  • PDF merging: bake() flattens annotations / form fields (including the visual stamp of digital signatures) into page content, then insert_pdf() copies pages losslessly — text stays vector, so file size does not bloat.
  • Image merging: image pages are embedded with JPEG compression (quality adjustable, default 90); transparent images get a white background.
  • The legacy rasterization implementation (pdf_to_images / images_to_pdf / merge_files_to_images) is kept only for backward compatibility and is no longer used.

PDF 与图片合并工具 PDF / PDF & Image Merger

一个基于 Python + Tkinter 的桌面小工具:拖入多个 PDF / 图片文件,自由排序后合并为单个 PDF。

A desktop tool based on Python + Tkinter: drag in multiple PDF / image files, reorder them, and merge them into a single PDF.

作者 / Author: BlueEve


中文说明

✨ 功能特性

  • 🖱 拖拽或点击添加 PDF / 图片文件
  • 🔀 支持上移 / 下移自由排序
  • 🔗 一键合并为单个 PDF
  • 🖼 支持 PDF、PNG、JPG、JPEG、BMP、TIFF、GIF、WEBP
  • 📏 合并前预估输出大小与总页数
  • 🪶 PDF 页面无损复制,输出体积 ≈ 输入文件之和(不再栅格化膨胀)
  • 🖍 保留数字签名的「证明章」外观(拍扁进页面内容,丢弃签名校验本身)

🛠 环境要求

⚠️ 请使用 Python 3.12(或更早的 3.10/3.11)。 Python 3.13/3.14 自带的 Tcl/Tk 为 9.x,与 tkinterdnd2 拖拽扩展不兼容,会导致 this extension is compiled for Tcl 8.x 报错。

  • Windows
  • Python 3.12

📦 安装依赖

python -m venv venv
venv\Scripts\python -m pip install -r requirements.txt

🚀 运行

venv\Scripts\python pdf_merger_gui.py

📐 打包为 exe

venv\Scripts\python build_exe.py

产物:dist\PDF合并工具.exe

如需重新生成图标:

venv\Scripts\python make_icon.py

🗂 项目结构

pdf_parser/
├── pdf_merger_gui.py   # GUI 界面(入口)
├── pdf_processor.py    # 核心处理逻辑
├── build_exe.py        # PyInstaller 打包脚本
├── make_icon.py        # 生成 exe 图标 icon.ico
├── requirements.txt    # 依赖
└── icon.ico            # 应用图标

🔍 技术要点

  • PDF 合并:先 bake() 把注释/表单(含数字签名章外观)烘焙为页面内容,再 insert_pdf() 无损复制页面 —— 文本仍是矢量,体积不膨胀。
  • 图片合并:图片页使用 JPEG 压缩嵌入(质量可调,默认 90),透明图自动铺白底。
  • 旧版「栅格化」实现(pdf_to_images / images_to_pdf / merge_files_to_images) 仅作兼容保留,不再使用。

About

A desktop tool based on Python + Tkinter: drag in multiple PDF / image files, reorder them, and merge them into a single PDF.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages