Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

PDF Deskew Tool

PyPI version License: MIT CI

English | 简体中文


English

Overview

PDF Deskew Tool is a powerful GUI and CLI application designed to automatically detect and correct skewed pages in scanned PDF documents. By leveraging PyMuPDF and OpenCV, it provides high-quality image processing to ensure your documents are perfectly aligned and highly readable.

Key Features

  • Smart Deskewing: Automatically detects and corrects rotation angles.
  • Batch Processing: Handle multiple PDF files simultaneously.
  • Image Enhancement:
    • Watermark Removal: Advanced inpainting to clean up documents.
    • Quality Boost: Contrast enhancement, denoising, and sharpening.
    • Grayscale Conversion: Reduce file size and improve clarity.
  • User Friendly:
    • Modern GUI: Built with PyQt6 and Material Design themes.
    • Drag & Drop: Easy file selection.
    • Bilingual: Full support for English and Chinese.
  • Flexible CLI: Robust command-line interface for automation and power users.

Installation

Recommended: Using uv

uv tool install pdf-deskew

Using pip

pip install pdf-deskew

Usage

GUI Application

Simply run the command to open the interface:

pdf-deskew

Command Line Interface (CLI)

# Basic usage (output saved as input_deskewed.pdf)
pdf-deskew-cli input.pdf

# Custom output and DPI
pdf-deskew-cli input.pdf -o output.pdf -d 600

# Enable all enhancements
pdf-deskew-cli input.pdf --enhance --remove-watermark

简体中文

概述

PDF 倾斜校正工具 (PDF Deskew Tool) 是一款功能强大的图形界面 (GUI) 和命令行 (CLI) 应用程序,专门用于自动检测并纠正扫描 PDF 文档中的页面倾斜。通过结合 PyMuPDF 和 OpenCV 的强大功能,它能提供高质量的图像处理,确保您的文档排列整齐、清晰易读。

核心功能

  • 智能纠偏:自动检测并修正页面旋转角度。
  • 批量处理:支持同时处理多个 PDF 文件,提高效率。
  • 图像增强:
    • 去除水印:使用先进的修复算法清理文档背景。
    • 画质提升:对比度增强、降噪及锐化处理。
    • 灰度转换:减小文件体积并提升文字清晰度。
  • 用户友好:
    • 现代界面:基于 PyQt6 和 Material Design 主题构建。
    • 拖放支持:支持直接拖入文件进行处理。
    • 双语支持:完整的中英文界面切换。
  • 灵活的命令行:为高级用户和自动化脚本提供强大的 CLI 支持。

安装方法

推荐方式:使用 uv

uv tool install pdf-deskew

使用 pip

pip install pdf-deskew

使用说明

图形界面 (GUI)

直接运行以下命令启动程序:

pdf-deskew

命令行界面 (CLI)

# 基本用法(输出默认为 input_deskewed.pdf)
pdf-deskew-cli input.pdf

# 指定输出路径和 DPI
pdf-deskew-cli input.pdf -o output.pdf -d 600

# 开启所有增强功能
pdf-deskew-cli input.pdf --enhance --remove-watermark

System Requirements / 系统要求

  • OS: Windows, macOS, or Linux
  • Python: 3.12 or higher
  • Dependencies: PyQt6, PyMuPDF, OpenCV, Pillow, numpy, deskew, qt-material, tqdm

Development / 开发

git clone https://github.com/tinnci/pdf_deskew.git
cd pdf_deskew
uv venv
# Windows: .venv\Scripts\activate | Linux/macOS: source .venv/bin/activate
uv pip install -e .
pytest

License / 许可证

This project is licensed under the MIT License.

Support / 支持

Metadata

Release files for pdf-deskew 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for pdf-deskew 0.1.8
File Size Uploaded Provenance Actions
pdf_deskew-0.1.8.tar.gz 63.0 kB Without provenance Details for pdf_deskew-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdf-deskew 0.1.8
File Interpreter ABI Platform Actions
pdf_deskew-0.1.8-py3-none-any.whl Python 3 none any Details for pdf_deskew-0.1.8-py3-none-any.whl

Total release size: 86.7 kB

Release files / pdf_deskew-0.1.8.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL pdf_deskew-0.1.8.tar.gz
Size 63.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1b62ac50c1760031ecb4d7aa6dfa186fa2a19ecdea7cc9337cbc35ac39d7f7f4
BLAKE2b-256 checksum
How to use checksums
580f1b5ab81aaf5ac5d8440473533e422890f21cc99ba6a43e351daa7343fc72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pdf_deskew-0.1.8-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL pdf_deskew-0.1.8-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
304968ac2daee92fb34e5499bf828118f7f64e9d1f29cc7ab42df8ea89350207
BLAKE2b-256 checksum
How to use checksums
0385b907270a29d0bcf28d0c172663447ff525ec83dd219e8f3652f04a7adbd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pdf-deskew 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.1.6 2 files With provenance
  • Added 0.1.8 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page