For developers
Tested code for extracting, editing, converting and OCR-ing PDFs, plus fixes for the errors you'll hit along the way.
Guides
PyMuPDF Tutorial: Read, Edit and Convert PDFs in Python
A practical PyMuPDF guide with tested code: extract text, tables and images, render pages, merge, split, watermark, redact, encrypt and compress PDFs.
How to OCR a PDF With PaddleOCR in Python
Extract text from scanned PDFs with PaddleOCR 3.x, then combine it with PyMuPDF to create a searchable PDF. Includes language setup, GPU, CLI and 2.x migration notes.
Python PDF Libraries Compared: PyMuPDF vs pypdf vs pdfplumber (and OCR)
Which Python library should you use for PDFs? A practical comparison of PyMuPDF, pypdf, pdfplumber, PaddleOCR and OCRmyPDF: features, speed and licences.
How to Convert PDF to Markdown for LLMs and RAG (Python)
Turn PDFs into clean Markdown for ChatGPT, Claude, LangChain or LlamaIndex pipelines with PyMuPDF4LLM, MarkItDown or Docling. Tested code, speed and scanned-PDF results.
AI Tools for Parsing PDFs: Docling, Marker, MinerU, olmOCR and More
A comparison of open-source AI document parsers for turning PDFs into Markdown or JSON for LLMs and RAG: what each is best at, hardware needs and licences.
Fix common errors
Fix pypdf "EOF marker not found" (PdfReadError)
Why pypdf and PyPDF2 raise 'EOF marker not found' or 'Stream has ended unexpectedly', and how to detect, avoid and repair broken PDF files in Python.
Fix pdf-lib "Input document to PDFDocument.load is encrypted"
Why pdf-lib refuses encrypted PDFs, why ignoreEncryption: true produces broken files, and how to decrypt the PDF first so pdf-lib can edit it.
Fix pdf.js "Setting up fake worker failed"
Why PDF.js shows 'Setting up fake worker failed' or 'No GlobalWorkerOptions.workerSrc specified', and how to load the worker correctly in Vite, webpack or a plain HTML page.
Fix OCRmyPDF "page already has text! – aborting" (PriorOcrFoundError)
Why OCRmyPDF stops with PriorOcrFoundError: page already has text, and when to use --mode skip, --mode force or --mode redo (--skip-text, --force-ocr, --redo-ocr).
Fix PaddleOCR "No available model hosting platforms detected" and "Unknown argument: use_gpu"
Solve PaddleOCR 3.x model download failures by choosing a reachable model source or using local model folders, and update old 2.x arguments like use_gpu and use_angle_cls.
PyMuPDF: "The fitz API is deprecated" and "No module named 'fitz'"
Should you import fitz or pymupdf? Fix the fitz deprecation warning, 'No module named fitz', and conflicts caused by installing the wrong 'fitz' package.