SkillAgentSearch skills...

PDFConverter

A lightweight Windows GUI tool for batch converting PDF files to images and converting documents (Word/CAJ) to PDF, with flexible page selection and ZIP export support.

Install / Use

/learn @Vance-Thomas/PDFConverter
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PDFConverter / PDF 批量转换器

<p align="center"> <img src="bin/logo/logo.png" alt="PDFConverter Logo" width="128" height="128"> </p> <p align="center"> <strong>Lightweight Windows GUI tool for batch document conversion</strong><br> </p> <p align="center"> 支持 PDF 转图片、Word/CAJ 转 PDF,并提供页码选择、批量处理、ZIP 压缩导出、拖拽导入和实时日志功能。 </p> <p align="center"> <a href="#overview--项目简介">Overview</a> • <a href="#features--功能特性">Features</a> • <a href="#quick-start--快速开始">Quick Start</a> • <a href="#usage--使用说明">Usage</a> • <a href="#project-structure--项目结构">Project Structure</a> • <a href="#dependencies--依赖说明">Dependencies</a> • <a href="#build--打包说明">Build</a> • <a href="#faq--常见问题">FAQ</a> • <a href="#license--许可证">License</a> </p>

Overview / 项目简介

PDFConverter is a Windows desktop GUI application built with Tkinter for convenient local batch document conversion.
It currently provides two major workflows:

  • PDF ➜ Images(PNG/TIFF/BMP/SVG)
  • Documents(Word/CAJ)➜ PDF

The tool is designed for users who prefer a simple local graphical interface instead of command-line tools. It focuses on practical batch conversion features, drag-and-drop import, clear output organization, flexible page selection, ZIP export, and runtime logging.


Features / 功能特性

1. PDF ➜ Images

Convert PDF files into high-quality images or SVG vector files.

Supported output formats

  • PNG
  • TIFF
  • BMP
  • SVG

Implemented capabilities

  • Batch conversion of multiple PDF files
  • Custom DPI setting for raster formats
  • Flexible page range selection
  • Separate output folder for each PDF file
  • Optional ZIP packaging for each converted PDF result
  • Automatic opening of the output directory after conversion
  • Real-time progress bar and log updates

2. Documents ➜ PDF

Convert Word-related documents and CAJ files into PDF.

Supported input formats

  • .doc
  • .docx
  • .docm
  • .dot
  • .dotx
  • .dotm
  • .rtf
  • .wps
  • .caj

Implemented capabilities

  • Batch conversion of multiple documents
  • Word-to-PDF conversion with primary and fallback strategies
  • CAJ-to-PDF conversion through integrated CAJ parser workflow
  • Optional page slicing after full-PDF generation
  • Unified PDF output directory
  • Optional ZIP packaging for the entire output folder

3. Page Selection

The tool supports flexible page selection for both PDF-to-image and document-to-PDF workflows.

Examples

  • all → all pages
  • 1 → page 1
  • 1,3,5 → pages 1, 3, and 5
  • 2-6 → pages 2 to 6
  • 1,3-5,8 → mixed page specification

Different files in a batch can use different page rules separated by semicolons.

Example:

1,3-5; ;2-4;all

This means:

  • File 1 → pages 1,3-5
  • File 2 → all pages
  • File 3 → pages 2-4
  • File 4 → all pages

4. GUI and Interaction

  • Windows desktop GUI
  • Drag-and-drop file import
  • Folder-based file loading
  • Mode switching:
    • PDF ➜ Images
    • Documents ➜ PDF
  • Input/output format linkage
  • DPI enable/disable linkage for SVG
  • Real-time progress bar
  • Real-time log panel
  • Daily log file persistence
  • Output directory browser
  • About dialog with environment and dependency information

5. Logging and Output Management

  • Daily log files stored in logs/
  • Automatic success/failure messages for each file
  • ZIP compression result logging
  • Conversion-complete message box
  • Automatic opening of output directory after conversion

Screenshots / 界面截图

Main Interface – PDF to Images Mode

<p align="center"> <img width="582" alt="PDF to Images Mode" src="https://github.com/user-attachments/assets/318dec0c-2168-431b-b7f7-4ebef08317cd" /> </p>

The PDF → Images mode allows batch conversion of PDF files into multiple image formats such as PNG, TIFF, BMP, and SVG. Users can set DPI, select page ranges, and optionally export results as ZIP packages.


Document to PDF Mode

<p align="center"> <img width="582" alt="Document to PDF Mode" src="https://github.com/user-attachments/assets/0423d79f-feb2-4bd2-b79f-f2215adea2e5" /> </p>

The Documents → PDF mode supports converting Word-related formats and CAJ documents into PDF files.
Users can batch import files, select page ranges, and generate PDF outputs in a unified directory.


About Dialog

<p align="center"> <img width="662" alt="About Dialog" src="https://github.com/user-attachments/assets/8e618d8c-eaa7-4daf-a4de-88cc1e562909" /> </p> The About dialog displays development environment information, dependency details, and project metadata.

Quick Start / 快速开始

Option 1: Download packaged executable

Go to the repository’s Releases page and download the latest packaged version,

  • PDFConverter_release.zip
  • PDFConverter.exe

After extraction, double-click the executable to run it.

The packaged executable does not require a separate Python installation.


Option 2: Run from source

1. Clone the repository

git clone https://github.com/<your-username>/PDFConverter.git
cd PDFConverter

2. Create a virtual environment

python -m venv .venv

3. Activate the virtual environment

PowerShell

.venv\Scripts\Activate.ps1

Command Prompt

.venv\Scripts\activate.bat

4. Install dependencies

pip install -r requirements.txt

5. Run the application

python PDFConverter.py

Usage / 使用说明

PDF ➜ Images

  1. Start the program
  2. Switch to PDF ➜ Images mode
  3. Import PDF files by:
    • clicking Browse
    • or dragging files into the drop area
  4. Select an output directory
  5. Choose the output format:
    • PNG
    • TIFF
    • BMP
    • SVG
  6. Set DPI if needed
  7. Enter page selection rules if needed
  8. Optionally enable ZIP packaging
  9. Click Start Batch Conversion

Output behavior

  • A root output folder named PDF2图片 will be created under the selected output directory
  • Each PDF file gets its own subfolder
  • If ZIP is enabled, each output folder will also be compressed into a .zip archive

Documents ➜ PDF

  1. Start the program
  2. Switch to 文档 ➜ PDF mode
  3. Select the input type:
    • Word
    • CAJ
  4. Import files
  5. Select an output directory
  6. Enter page selection rules if needed
  7. Optionally enable ZIP packaging
  8. Click Start Batch Conversion

Output behavior

  • A root output folder named 文档2PDF will be created under the selected output directory
  • Each converted document will be exported as a PDF file
  • If page rules are specified, the generated PDF will be sliced accordingly
  • If ZIP is enabled, the output folder will be compressed

Conversion Logic

PDF ➜ Images

  • The program opens the PDF using PyMuPDF
  • User page rules are parsed into internal 0-based page indices
  • Each selected page is rendered or exported:
    • Raster formats use get_pixmap() and Pillow saving
    • SVG uses get_svg_image()
  • Output files are named by page number and DPI
  • TIFF uses lossless deflate compression

Documents ➜ PDF

  • Word documents are first converted to PDF
    • Primary method: docx2pdf
    • Fallback method: pywin32 + Microsoft Word COM
  • CAJ documents are converted using the integrated CAJ parser workflow
  • A temporary full PDF is generated first
  • If page slicing is required, a new PDF containing only selected pages is created
  • Temporary PDFs are removed after processing

Project Structure / 项目结构

PDFConverter/
├── PDFConverter.py                  # Main application entry / 主程序入口
├── README.md                        # Project documentation / 项目说明文档
├── LICENSE                          # License file / 许可证文件
├── requirements.txt                 # Python dependencies / 依赖清单
├── logs/                            # Runtime logs / 运行日志
└── bin/
    ├── logo/                        # Logo and icon resources / 图标资源
    │   ├── logo.png
    │   ├── logo_f1.png
    │   └── logo_f2.png
    └── convert_caj/                 # CAJ conversion module / CAJ 转 PDF 模块
        ├── cajparser.py
        ├── utils.py
        └── mutool.exe

Dependencies / 依赖说明

Core Python libraries

  • PyMuPDF (fitz)
    Used for PDF parsing, page loading, rendering, slicing, and SVG export.

  • Pillow (PIL)
    Used for image creation and saving.

  • Tkinter
    Used for the desktop GUI.

  • tkinterdnd2
    Used for drag-and-drop file import.

  • docx2pdf
    Used as the preferred Word-to-PDF converter.

  • pywin32
    Used as a fallback Word-to-PDF solution through Microsoft Word COM automation.

  • zipfile
    Used for ZIP archive generation.

  • datetime
    Used for daily log naming and timestamp recording.


Requirements

Operating System

  • Windows 10 / 11 recommended

Python

  • Python 3.10+ recommended
  • Developed and tested with Python 3.12.x

Additional requirements

  • For Word-to-PDF conversion via COM fallback, Microsoft Word should be installed locally
  • For drag-and-drop support, tkinterdnd2 should be installed

Example requirements.txt

PyMuPDF
Pillow
tkinterdnd2
docx2pdf
pywin32

Install with

pip install -r requirements.txt

Logs

The application stores daily log files in the logs/ directory.
Each log file is named in the following format:

log_YYYY-MM-DD.txt

The log records include:

  • mode switching
  • file import results
  • conversion start messages
  • per-file success or failure
  • ZIP compression results
  • log clearing actions

Build / 打包说明

The application can be packaged into a standalone Windows executable using PyInstaller.

Example build command

pyinstaller -F -w `
-i "bin/logo/logo.png" `
--add-data "bin;bin" `
--add-binary "C:/Users/<Users>/AppData/Local/Programs/Python/Python312/tcl/tcl8.6;./tcl" `
--add-binary "C:/Users/<Users>/AppData/Local/Programs/Python/Python312/tcl/tk8.6;./tk" `
PDFConverter.py

Optional

View on GitHub
GitHub Stars4
CategoryCustomer
Updated29d ago
Forks0

Languages

Python

Security Score

70/100

Audited on Mar 8, 2026

No findings