Agent Skillsxberg-io/xberg › pdf-backends

pdf-backends

GitHub

指导 Xberg PDF 引擎的后端配置、选择与诊断,涵盖 Native 和 Pdfium 两种后端的使用规范、OCR 回退机制及渲染会话管理。

.ai-rulez/skills/pdf-backends/SKILL.md xberg-io/xberg

Trigger Scenarios

PDF 提取或渲染问题排查 Native/Pdfium 后端切换配置 加密文档处理 OCR 回退策略调整

Install

npx skills add xberg-io/xberg --skill pdf-backends -g -y
More Options

Non-standard path

npx skills add https://github.com/xberg-io/xberg/tree/main/.ai-rulez/skills/pdf-backends -g -y

Use without installing

npx skills use xberg-io/xberg@pdf-backends

指定 Agent (Claude Code)

npx skills add xberg-io/xberg --skill pdf-backends -a claude-code -g -y

安装 repo 全部 skill

npx skills add xberg-io/xberg --all -g -y

预览 repo 内 skill

npx skills add xberg-io/xberg --list

SKILL.md

Frontmatter
{
    "name": "pdf-backends",
    "description": "Change or diagnose Xberg PDF extraction, native\/Pdfium backend selection, PDF rendering sessions, encrypted documents, OCR fallback, or backend-specific capability gaps. Load for PDF engine work, not generic image OCR."
}

PDF backends

PdfConfig.backend selects PdfBackend::Native (default) or PdfBackend::Pdfium. Backend choice is explicit: never silently return native output when Pdfium was requested.

Native backend

  • The native engine is xberg_native_pdf and supports the full Xberg PDF pipeline: text and structure extraction, page rendering/OCR fallback, tables, annotations, images, attachments, and richer metadata.
  • config.force_ocr forces the whole document; config.force_ocr_pages selects pages. Otherwise, pages without usable native text can enter the OCR stage inside PdfExtractor; OCR is not a second PDF extractor in the registry.
  • PdfRenderSession in pdf/render.rs opens document bytes once and exposes page count and page rendering. Use it for repeated page renders instead of reopening the same document for each page. It is a Rust primitive and need not be exposed by every binding.

Pdfium backend

  • Pdfium requires the pdf-pdfium Cargo feature. Selecting it without that feature must return an actionable error.
  • Runtime dynamic loading honors PDFIUM_DYNAMIC_LIB_PATH as a directory containing the platform library. Build-time static and dynamic link variables are not interchangeable with runtime discovery.
  • Pdfium binding is process-global and operations are serialized by the engine lock. Preserve that invariant when changing concurrency.
  • The Pdfium implementation intentionally has a narrower capability surface: text, page count, and Info-dictionary metadata. It warns about omitted native capabilities rather than pretending parity.

Verification

Test backend selection separately from document semantics. A missing Pdfium runtime is infrastructure failure unless the job promises to provision it; when XBERG_REQUIRE_PDFIUM is set, skipping because the library or fixture is absent is a failure. Use corpus fixtures through the test-corpus skill and include Pdfium artifacts in benchmark aggregation when the adapter is enabled.

Version History

  • d8e4815 Current 2026-08-28 18:30

Same Skill Collection

.ai-rulez/skills/alef-generated-bindings/SKILL.md
.ai-rulez/skills/benchmark-workflow/SKILL.md
.ai-rulez/skills/chunking-embeddings/SKILL.md
.ai-rulez/skills/config-loading-precedence/SKILL.md
.ai-rulez/skills/crate-structure/SKILL.md
.ai-rulez/skills/extraction-pipeline-patterns/SKILL.md
.ai-rulez/skills/feature-flag-policy/SKILL.md
.ai-rulez/skills/mime-detection-routing/SKILL.md
.ai-rulez/skills/ocr-pipeline-and-quality/SKILL.md
.ai-rulez/skills/plugin-architecture-patterns/SKILL.md
.ai-rulez/skills/polyrepo-boundaries/SKILL.md
.ai-rulez/skills/release-readiness/SKILL.md
.ai-rulez/skills/release-versioning/SKILL.md
.ai-rulez/skills/test-corpus/SKILL.md
.ai-rulez/skills/wasm-constraints/SKILL.md
.ai-rulez/skills/xberg-typescript-toolchain/SKILL.md
plugin/.ai-rulez/skills/batch-extraction/SKILL.md
plugin/.ai-rulez/skills/chunking/SKILL.md
plugin/.ai-rulez/skills/extracting-keywords/SKILL.md
plugin/.ai-rulez/skills/extracting-tables/SKILL.md
plugin/.ai-rulez/skills/extracting-with-ocr/SKILL.md
plugin/.ai-rulez/skills/picking-a-format/SKILL.md
plugin/.ai-rulez/skills/xberg/SKILL.md
plugin/.cursor-plugin/skills/batch-extraction/SKILL.md
plugin/.cursor-plugin/skills/chunking/SKILL.md
plugin/.cursor-plugin/skills/extracting-keywords/SKILL.md
plugin/.cursor-plugin/skills/extracting-tables/SKILL.md
plugin/.cursor-plugin/skills/extracting-with-ocr/SKILL.md
plugin/.cursor-plugin/skills/picking-a-format/SKILL.md
plugin/.cursor-plugin/skills/xberg/SKILL.md
plugin/skills/batch-extraction/SKILL.md
plugin/skills/chunking/SKILL.md
plugin/skills/extracting-keywords/SKILL.md
plugin/skills/extracting-tables/SKILL.md
plugin/skills/extracting-with-ocr/SKILL.md
plugin/skills/picking-a-format/SKILL.md
plugin/skills/xberg/SKILL.md
.ai-rulez/skills/api-server-mcp/SKILL.md
.ai-rulez/skills/format-specific-extraction/SKILL.md

Metadata

Files
0
Version
d8e4815
Hash
6caf4a01
Indexed
2026-08-28 18:30

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-31 21:07
浙ICP备14020137号-1 $bản đồ khách truy cập$