asdrubalivan

K2pdfopt Skill — Development skill for Claude Code

Development community

Claude Code skill: convert PDF books to Kindle/Kobo-ready PDFs via k2pdfopt, verified by statistical page sampling.

How to install K2pdfopt Skill

This entry records only its repository, not the path inside it, so there is no exact command to give. Open asdrubalivan/k2pdfopt-skill and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What K2pdfopt Skill does

Claude Code skill: convert PDF books to Kindle/Kobo-ready PDFs via k2pdfopt, verified by statistical page sampling.

Alternatives in Development

  • Book To Skill — Turn any technical book PDF into a Claude Code skill — ready to study, reference, and use while you work 25.9k ★
  • Package OfficeCLI Skill As AionUi Assistant — Convert an OfficeCLI skill into a fully wired AionUi assistant preset, or update an existing one 20.3k ★
  • Translate Book — Claude Code skill that translates entire books (PDF/DOCX/EPUB) into any language using parallel subagents 542 ★

README

🇪🇸 [Leer en español](README.es.md)

k2pdfopt

A Claude Code skill that converts scanned/native PDF books into Kindle- and Kobo-ready PDFs with [k2pdfopt](https://www.willus.com/k2pdfopt/), then verifies the result by sampling rendered pages instead of trusting the conversion blind — or rendering all of them.

![Cover comparison: original scan vs. Kindle grayscale vs. Kobo Libra Colour](docs/screenshots/cover-comparison.png) *Real conversion, same book: 2.9 MB / 140-page scan → 51.3 MB / 727-page grayscale Kindle output (`-fs 18`) and 97.8 MB / 717-page color Kobo Libra Colour output (`-fs 22`). Cover photo and publisher logos blurred here for copyright reasons — the source book isn't ours to redistribute; the point is the grayscale/color contrast, which survives the blur.*

The problem

A PDF built for print or scanned from a physical book does not read well on a 6-7" e-ink panel: tiny justified text, margins sized for 8.5x11 paper, and sometimes JPEG2000-encoded scan images that not every reader decodes. A single `k2pdfopt` invocation isn't enough on its own, either — you have to pick the right mode/device profile/DPI for the *target device*, and on a 700+ page reflowed output you have no practical way to confirm nothing broke without opening the whole book.

What the skill does

  1. Resolves the k2pdfopt binary — no Homebrew formula exists for it (see below), so this is a real step, not a formality.
  2. Inspects the source PDF — page count, whether it's a real text layer or a pure scan, whether it embeds JPEG2000 images.
  3. Pre-flattens JPEG2000 scans to JPEG when needed — some k2pdfopt builds don't decode JP2 reliably; poppler does, so it's used as a pre-pass instead of gambling on silent corruption.
  4. Picks target device(s) — Kindle, Kobo Libra, or both.
  5. Calibrates large-print settings, only if asked — font size in points is tuned per device (see below for why that's not a constant), with an optional visual size