One Open Source Project a Day (Part 53): PDF 补丁丁 - Full-Featured PDF Toolbox for Bookmarks, Restrictions, Merge/Split, OCR

Deep dive into PDF 补丁丁 (PDFPatcher), a .NET-based PDF tool supporting bookmark editing, page crop/rotate, restriction removal, extract/merge documents, structure exploration, OCR, font replacement — permanently free, no ads

·5 min read·Tool Recommendations

Introduction

"Permanently free, never expires, no ads, no popups, no privacy snooping."

This is Part 53 of the "One Open Source Project a Day" series. Today's project is PDF 补丁丁 (PDFPatcher, GitHub).

Need to edit PDF bookmarks, remove copy/print restrictions, merge/split documents, extract images, or turn image-based PDFs into searchable bookmarks? PDF 补丁丁 is a PDF toolbox built on the .NET Framework: supports bookmark editing, page crop/rotate, restriction removal, extract/merge documents, structure exploration, OCR, font replacement, and more. Licensed under AGPL + Conscience License, permanently free, no ads, no popups.

What You'll Learn

  • PDFPatcher's core features and use cases
  • Technical architecture: iText + MuPDF dual-engine
  • Bookmark editor, document merge, OCR and other highlights
  • Meaning of the Conscience License
  • Comparison with similar PDF tools

Prerequisites

  • Basic understanding of PDF documents
  • Windows experience (tool is Windows-only)

Project Background

Project Overview

PDF 补丁丁 (PDFPatcher) is a PDF processing tool built with .NET Framework, using iText and MuPDF as core libraries. iText handles parsing, generation, modification, and font embedding; MuPDF handles PDF-to-bitmap rendering. Features cover editing, creation, split/merge, OCR, and structure analysis.

Author

Project Data


Core Features

Main Capabilities

CategoryFeatures
ModifyDocument properties, page numbers, links; unify page size; remove auto-open actions; remove copy/print restrictions; set reader initial mode; clean hidden junk; recompress B&W images; rotate pages
BookmarksReading UI (vertical right-to-left); batch edit bookmark properties; precise bookmark positioning; find/replace (regex, XPath); auto-generate bookmarks
Create PDFMerge PDFs or images; keep or add bookmarks; generate bookmarks from filenames; unify page size
Split/MergeSplit or merge PDFs, preserve or add bookmarks
ExtractHigh-speed lossless image export; pages to images; extract/delete pages; reorder pages
AdvancedRename by metadata; OCR (Microsoft Office MODI); image PDF TOC to bookmarks; font replacement; embed fonts
StructureTree view of document structure; edit nodes; export to XML

Use Cases

  1. Ebook organization: Merge scanned PDFs, generate bookmarks, unify page size
  2. Remove restrictions: Remove copy/print limits for easier reading and citation
  3. Batch processing: Rename by metadata, extract pages, batch export images
  4. Image PDF optimization: OCR TOC pages into clickable bookmarks
  5. Font embedding: Embed fonts to fix garbled text on Kindle and similar devices

Quick Start

Requirements:

  • Windows 7 or later
  • .NET Framework 4.0–4.8
  • OCR requires Microsoft Office 2003/2007 Document Imaging (MODI)

Download:

Get the latest release from GitHub Releases, extract and run — no installer.

Build from source (optional):

  • Visual Studio 2022 or newer
  • ".NET desktop development" and "C++ desktop development" workloads
  • Target .NET Framework 4.8

Conscience License

AGPL + Conscience License: The software is under AGPL with an extra condition — "if the software helps you, do one good deed after each use." Deeds can be small; intention matters. If you build commercial software from the source and earn revenue, donate at least 0.1% to those in need. Compliance is a matter of conscience.

Project Advantages

ComparisonPDFPatcherCommercial PDF ToolsOnline PDF Tools
CostPermanently freeSubscriptionFree/limited
AdsNoneNonePossible
PrivacyLocal processingVariesUpload risk
FeaturesEdit, OCR, structureFull-featuredBasic
PlatformWindows onlyMulti-platformCross-platform

Deep Dive

Technical Architecture

Core components:

  • iText: .NET library for parsing, generating, modifying PDF, embedding TTF font subsets
  • MuPDF: C library for PDF-to-bitmap rendering, called via P/Invoke (SharpMuPDF)
  • JBig2: JBIG2 image encode/decode

Other components: ObjectListView, FreeImage, Cyotek ImageBox, TabControlExtra, HTMLRenderer, etc.

Source Structure

PDFPatcher/
├── App/              # Main application
│   ├── Common/       # Utilities
│   ├── Functions/    # UI and controls
│   ├── Lib/          # Third-party libs
│   ├── Model/        # Models
│   ├── Options/      # Options
│   └── Processor/    # PDF processing (incl. Mupdf P/Invoke)
├── JBig2/            # JBIG2 codec
├── doc/              # Documentation
└── 使用手册.docx

Feature Highlights

Bookmark editor: Regex and XPath support, quick selection of chapter/section bookmarks, auto-generation of document bookmarks.

OCR: Uses Microsoft Office MODI (Document Imaging) to recognize text in images and convert image PDF TOC pages into clickable bookmarks.

Font replacement and embedding: Replace document fonts; embed fonts into PDF to fix garbled text on devices like Kindle.


Official Resources

Target Audience

  • Ebook organization, scanned PDF handling
  • Users needing to remove PDF restrictions
  • Users needing batch merge, split, page extraction
  • Users needing OCR and font embedding
  • PDF format enthusiasts and developers

Visit my homepage for more useful knowledge and interesting products