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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
contentfield, 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, orall.--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=trueunless you have a reason. - For batch OCR, use
xberg batch *.pdf --ocr=true— internal worker pool parallelizes across CPU cores. Cap with--max-concurrent Nif 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=trueonly when pages may be rotated; the classifier adds latency. - On Apple Silicon,
--acceleration coremltypically 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.
댓글
- …
이 저장소의 다른 스킬
xberg-batch-extraction
9.5k에이전트가 Xberg로 많은 문서를 한 번에 처리하도록 돕습니다. 공통 옵션을 쓰고, 실패한 파일이 나머지를 멈추지 않게 합니다.
xberg-chunking
9.5k에이전트가 긴 문서 텍스트를 AI 프롬프트나 검색 색인에 맞게 작은 조각으로 나누도록 돕습니다. 크기와 겹침을 정할 수 있습니다.
xberg-extracting-keywords
9.5k에이전트가 문서에서 핵심 키워드나 핵심 구문을 뽑고 문서의 언어를 감지하도록 돕습니다. Xberg의 키워드 설정을 사용합니다.
xberg-extracting-tables
9.5k에이전트가 PDF, 스프레드시트, 이미지에서 표를 뽑고, 행과 열을 유지한 채 마크다운이나 구조화된 데이터로 바꾸도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.