pdf-backends

pdf-backends is a skill for Claude Code, Codex from xberg-io/xberg. It costs 46 tokens per session (469 once invoked), scanned A, original, MIT.

A guide for choosing and working with the PDF engines used by Xberg, a document extraction system. It covers the default native engine, the optional Pdfium engine, page rendering, and OCR for pages without usable text.

In plain words
What is it for?
Use it to change PDF backend selection, diagnose extraction or rendering problems, configure OCR, support encrypted documents, load Pdfium libraries, and reuse an open document during multiple renders.
Why use it?
It helps developers avoid using the wrong engine or silently getting different results than requested. It also explains how to handle encrypted PDFs, missing Pdfium support, and repeated page rendering.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to change PDF backend selection, diagnose extraction or rendering problems, configure OCR, support encrypted documents, load Pdfium libraries, and reuse an open document during multiple renders.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xberg-io/xberg/pdf-backends
About the project

Xberg is a document-intelligence engine that reads files, URLs, archives, and source trees and extracts text, metadata, images, tables, and structured data, with additional code-language understanding. Developers use it through language bindings, a command-line tool, REST API, or MCP server, and the catalogue entries support those integrations.

xberg-io/xberg · 9,275 stars · on GitHub · docs.xberg.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xberg-io/xberg --skill pdf-backends
Clone the repo
git clone --depth 1 https://github.com/xberg-io/xberg

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pdf-backends

README.md
[![agentmods](https://agentmods.dev/badge/skills/xberg-io/xberg/pdf-backends.svg)](https://agentmods.dev/skills/xberg-io/xberg/pdf-backends)
Your own site
<a href="https://agentmods.dev/skills/xberg-io/xberg/pdf-backends"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/pdf-backends.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 469 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.00469
Opus 5 $0.00023 $0.00234
Sonnet 5 $0.00009 $0.00094
Haiku 4.5 $0.00005 $0.00047

Measured 8d ago against content hash 6caf4a01560c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pdf-backends scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.ai-rulez/skills/pdf-backends/SKILL.md · 39 lines

What it actually says

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.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 39 lines · 46 tokens per session scan A 6caf4a01560c

Subscribe to this mod's changes

pdf-backends is a skill published in the GitHub repository xberg-io/xberg (9,275 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 469 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

mem0-status

Diagnoses mem0 connectivity, API key validity, and memory read/write functionality. Use when memory operations fail, searches return empty, addmemory errors occur, or to verify the plugin is working correctly.

mem0ai/mem0 · 44 tokens

notebooklm

Install, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API.…

teng-lin/notebooklm-py · 79 tokens

eve

Build durable backend AI agents with the eve framework. Use when creating, editing, or debugging an eve project — agent instructions, skills, tools, connections, channels, sandboxes, subagents, schedules, or evals.

ComposioHQ/composio · 47 tokens

using-the-mcp-server

Use when converting HTML to Markdown or extracting metadata and tables through the html-to-markdown MCP server's tools, rather than shelling out to the CLI. Covers the tool surface, the auto-installing launcher, and when MCP beats the CLI or SDK.

xberg-io/html-to-markdown · 57 tokens

guardrails-developer-guide

Routes NVIDIA NeMo Guardrails library product-usage questions to the canonical documentation. Use when users ask how to install, configure, integrate, evaluate, observe, deploy, troubleshoot, or use the NVIDIA NeMo Guardrails library. Trigger keywords - install guardrails, configure rails, guardrail catalog, Colang…

NVIDIA-NeMo/Guardrails · 92 tokens

extraction-pipeline-patterns

Kreuzberg's format detection -> extraction -> fallback orchestration for 75+ file formats.

kreuzberg-dev/kreuzberg-lts · 11 tokens