# Xberg Extracting With Ocr

Use when extracting text from scanned PDFs, photographed pages, or images that have no...

- Repository: https://github.com/xberg-io/xberg (9506 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add xberg-io/xberg --skill xberg-extracting-with-ocr -g -a claude-code -y`
Codex: `npx skills add xberg-io/xberg --skill xberg-extracting-with-ocr -g -a codex -y`
Cursor: `npx skills add xberg-io/xberg --skill xberg-extracting-with-ocr -g -a cursor -y`
Gemini CLI: `npx skills add xberg-io/xberg --skill xberg-extracting-with-ocr -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add xberg-io/xberg`

## Description

Use when extracting text from scanned PDFs, photographed pages, or images that have no embedded text layer. Covers OCR backends, language packs, force-OCR, and performance tuning.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

<!--
AI-RULEZ :: GENERATED FILE, DO NOT EDIT
Content-Hash: blake3:b1718303d659167ff376b4e1d4baf546d3e74f8f0804698a3486c0a1d2e6c913
Source-Hash: blake3:4a90223a333b0f963ae8cdec4f38db88b769132c5dd1b7f39a7fe8e84f57f83e
Schema-Version: v1
-->

# Extracting with OCR

Use this when a document is image-based: scanned PDFs, photographed pages,
screenshots, JPEG/PNG/TIFF with text. Xberg auto-OCRs raster images and
auto-detects PDFs that lack a text layer. Force it on when extraction
returned empty/garbled text from a PDF that "looks" textual.

## When to force OCR

- Extraction returned an empty `content` field, but the file opens visually.
- The PDF text layer is junk (copy-paste from a viewer produces gibberish).
- You want consistent output across mixed scanned + digital PDFs.

```bash
xberg extract scan.pdf --force-ocr=true
xberg extract scan.pdf --ocr=true --ocr-language eng
```

If a page has an unreliable text layer, `--force-ocr=true` re-rasterizes
and runs OCR on every page.

## Backends

Tesseract is the default and ships with the CLI, no extra install. Other
backends are opt-in:

The rest: https://github.com/xberg-io/xberg/blob/HEAD/plugin/.cursor-plugin/skills/xberg-extracting-with-ocr/SKILL.md
