Scripts2026年4月10日·1 分钟阅读

Stirling PDF — Self-Hosted PDF Editor & Toolkit

Stirling PDF is the #1 open-source PDF tool on GitHub. Merge, split, convert, compress, OCR, sign, and edit PDFs — all self-hosted with no data leaving your server.

SC
Script Depot · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

docker run -d --name stirling-pdf -p 8080:8080 
  -v stirling-data:/usr/share/tessdata 
  frooodle/s-pdf:latest

Open http://localhost:8080 — start editing PDFs immediately, no account needed.

介绍

Stirling PDF is a self-hosted PDF manipulation tool that handles virtually every PDF operation you might need. With 76.5K+ GitHub stars, it's the most popular PDF application on GitHub, providing merge, split, convert, compress, OCR, sign, watermark, and dozens more operations — all through a clean web interface with zero data leaving your server.

What Stirling PDF Does

50+ PDF operations organized by category:

Page Operations

  • Merge multiple PDFs into one
  • Split PDF by pages, size, or bookmarks
  • Rotate, reorder, and remove pages
  • Extract specific page ranges
  • Add page numbers

Conversion

  • PDF ↔ Image (PNG, JPEG, TIFF, WebP)
  • PDF → Word (DOCX), Excel, PowerPoint
  • HTML → PDF, Markdown → PDF
  • PDF ↔ PDFA (archival format)

Security

  • Add/remove password protection
  • Add digital signatures
  • Redact sensitive content
  • Add watermarks (text or image)
  • Set permissions (print, copy, edit)

Document Processing

  • OCR (extract text from scanned PDFs)
  • Compress PDF file size
  • Flatten forms
  • Extract images from PDF
  • Add/edit metadata

Advanced

  • Compare two PDFs visually
  • Auto-rename based on content
  • Multi-page layout (2-up, booklet)
  • Repair corrupted PDFs

Self-Hosting

Docker (Simple)

docker run -d --name stirling-pdf 
  -p 8080:8080 
  -v ./training-data:/usr/share/tessdata 
  -v ./configs:/configs 
  -e DOCKER_ENABLE_SECURITY=false 
  frooodle/s-pdf:latest

Docker Compose (with OCR languages)

services:
  stirling-pdf:
    image: frooodle/s-pdf:latest
    ports:
      - "8080:8080"
    volumes:
      - ./training-data:/usr/share/tessdata
      - ./configs:/configs
      - ./logs:/logs
    environment:
      DOCKER_ENABLE_SECURITY: "false"
      INSTALL_BOOK_AND_ADVANCED_HTML_OPS: "true"
      LANGS: "zh_sim,zh_tra,eng,jpn,kor"  # OCR languages
    restart: unless-stopped

Full Version (with LibreOffice)

# Full version includes Word/Excel/PPT conversion
docker run -d frooodle/s-pdf:latest-fat

Key Features

API Access

Every operation is available via REST API:

# Merge PDFs
curl -X POST http://localhost:8080/api/v1/general/merge-pdfs 
  -F "fileInput=@file1.pdf" 
  -F "fileInput=@file2.pdf" 
  -o merged.pdf

# Convert PDF to images
curl -X POST http://localhost:8080/api/v1/convert/pdf/img 
  -F "fileInput=@document.pdf" 
  -F "imageFormat=png" 
  -F "dpi=300" 
  -o images.zip

# OCR a scanned PDF
curl -X POST http://localhost:8080/api/v1/misc/ocr-pdf 
  -F "fileInput=@scanned.pdf" 
  -F "languages=chi_sim+eng" 
  -o ocr-result.pdf

# Compress PDF
curl -X POST http://localhost:8080/api/v1/general/optimize-pdf 
  -F "fileInput=@large.pdf" 
  -F "optimizeLevel=3" 
  -o compressed.pdf

Multi-Language OCR

Stirling PDF uses Tesseract OCR with support for 100+ languages:

Language Code
English eng
Simplified Chinese chi_sim
Traditional Chinese chi_tra
Japanese jpn
Korean kor
German deu
French fra
Spanish spa

Pipeline Operations

Chain multiple operations together:

Input PDFOCRCompressAdd WatermarkPassword ProtectOutput

Why Self-Host PDF Tools?

Cloud PDF tools (iLovePDF, SmallPDF, etc.):
✗ Your documents uploaded to third-party servers
✗ File size limits on free tier
✗ Monthly subscription for full features
✗ Privacy concerns for sensitive documents

Stirling PDF:
✓ Documents never leave your server
✓ No file size limits
✓ All features free, forever
✓ Perfect for sensitive/legal/medical documents

常见问题

Q: Stirling PDF 支持中文 OCR 吗? A: 支持。通过 LANGS 环境变量配置 chi_sim(简体中文)或 chi_tra(繁体中文)。首次使用会自动下载对应语言包。

Q: 普通版和 fat 版有什么区别? A: 普通版包含基础 PDF 操作。fat 版额外包含 LibreOffice,支持 PDF ↔ Word/Excel/PPT 互转。fat 版镜像约 1.5GB,普通版约 400MB。

Q: 处理大文件有限制吗? A: 自托管版本没有文件大小限制。处理速度取决于服务器配置。建议大文件 OCR 分配至少 2GB RAM。

来源与致谢

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产