본문으로 건너뛰기
Skillpedia
PDF, Word, 슬라이드9.5k · #12272

xberg-extracting-with-ocr

하는 일

이 스킬은 이미지 기반 문서에서 OCR로 텍스트를 얻는 방법을 보여 줍니다. 스캔한 서류, 촬영한 페이지, 스크린샷을 가진 사람을 위한 것입니다.

사용하는 경우

  • ✓스캔한 PDF나 페이지 사진에서 텍스트가 필요할 때.
  • ✓PDF에서 내용이 비거나 깨져 나오지만 화면에서는 읽을 수 있을 때.
  • ✓다른 언어로 된 문서의 텍스트가 필요하고 인식 언어를 정해야 할 때.

스킬 링크

https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-extracting-with-ocr/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-extracting-with-ocr/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 스캔한 계약서 PDF에서 텍스트를 뽑아 주세요. 스페인어로 작성되어 있습니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 OCR을 켜거나, 텍스트 층이 나쁘면 모든 페이지에 강제로 적용합니다. 기본적으로 내장된 Tesseract 엔진을 쓰고, 인식에 사용할 언어를 설정할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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.
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:

Backend Flag Install Notes
Tesseract --ocr-backend tesseract (default) bundled Best general-purpose, 100+ languages via tessdata.
PaddleOCR --ocr-backend paddle-ocr bundled (ONNX Runtime) Strong on Asian scripts. Not available on WASM or Windows.
Candle VLM --ocr-backend candle-trocr (and other candle-*) bundled (Candle) Local vision OCR models (candle-trocr, candle-paddleocr-vl, candle-glm-ocr, candle-deepseek-ocr).
VLM (hosted) --ocr-backend vlm + --vlm-model liter-llm provider (--vlm-api-key) Multimodal LLM via liter-llm. Use when OCR fails on dense or handwritten layouts.

Pick Tesseract first. Switch only when accuracy is unacceptable.

Language packs

Tesseract uses ISO 639-2 codes. Default is eng. Combine with +:

xberg extract menu.jpg --ocr=true --ocr-language "eng+deu"
xberg extract bilingual.pdf --ocr-language "eng+jpn"
xberg extract any.pdf --ocr-language all   # all installed packs

Install missing packs at the OS level:

# macOS
brew install tesseract-lang

# Debian/Ubuntu
sudo apt install tesseract-ocr-deu tesseract-ocr-jpn tesseract-ocr-fra

# Specific lang only
sudo apt install tesseract-ocr-<iso639-2>

Xberg fails fast with a helpful error if you request a language pack that is not installed. Read the error — it names the missing file.

Useful flags

  • --ocr=true — enable OCR (auto-enabled for images and scanned PDFs).
  • --force-ocr=true — OCR every page even if a text layer exists.
  • --disable-ocr=true — never OCR; use embedded text where available. Images and image-only pages can return metadata with no recognized text.
  • --ocr-language <lang> — single code or +-joined list, or all.
  • --ocr-backend <tesseract|paddle-ocr|vlm|candle-trocr|candle-paddleocr-vl|candle-glm-ocr|candle-deepseek-ocr> — pick backend.
  • --ocr-auto-rotate=true — pre-rotate via the auto-rotate model.
  • --acceleration <cpu|coreml|cuda|tensorrt|auto> — ONNX accelerator for paddle-ocr / auto-rotate / layout models.

Performance tips

  • Cache is on by default. Repeated extraction of the same file + config is instant. Do not pass --no-cache=true unless you have a reason.
  • For batch OCR, use xberg batch *.pdf --ocr=true — internal worker pool parallelizes across CPU cores. Cap with --max-concurrent N if memory is tight.
  • Raise --target-dpi (default 300) only for low-resolution scans. Higher DPI is slower; 200 is usually enough for printed text.
  • Enable --ocr-auto-rotate=true only when pages may be rotated; the classifier adds latency.
  • On Apple Silicon, --acceleration coreml typically beats CPU for paddle-ocr and layout detection.

Config file alternative

Long flag chains belong in xberg.toml — auto-discovered from cwd upward.

force_ocr = true
output_format = "markdown"

[ocr]
backend = "tesseract"
language = "eng+deu"
auto_rotate = true

Then just run:

xberg extract document.pdf

Common failure modes

  • "missing tessdata" — install the language pack at OS level (see above).
  • Empty content on a scanned PDF without --force-ocr — the file has a bog
자주 묻는 질문

OCR에 별도 소프트웨어가 필요한가요?

Tesseract가 도구와 함께 기본 제공되므로 기본 사용에는 추가 설치가 필요 없습니다. 다른 OCR 엔진은 선택 사항입니다.

강제 OCR이란 무엇인가요?

페이지에 일부 텍스트가 들어 있어도 모든 페이지를 OCR로 읽는다는 뜻입니다.

어떤 언어를 지원하나요?

Tesseract는 언어 데이터 파일을 통해 100개가 넘는 언어를 지원합니다.

상세 정보

작성자의 원본 설명

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.

repo: xberg-io/xberg

인기도

GitHub 스타
9.5k
순위
#12272
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬