pdf-annotations

pdf-annotations is a skill for Claude Code, Codex from rcosteira79/android-skills. It costs 141 tokens per session (1,558 once invoked), scanned A, original, MIT.

Guidance for editing PDF highlights, text notes, stamps, drawings, text, and images using Android's built-in PDF tools.

In plain words
What is it for?
Use it when an Android app must read, add, change, or remove PDF annotations or page content, then save the edited file.
Why use it?
It helps developers handle Android's different PDF editing support across operating-system versions instead of assuming every device exposes the same tools.

Skill for Claude CodeCodex

Part of the android-skills plugin — 21 skills shipped together

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.

agentmods
npx agentmods add skills/rcosteira79/android-skills/pdf-annotations
Any agent
npx skills add rcosteira79/android-skills --skill pdf-annotations
Clone the repo
git clone --depth 1 https://github.com/rcosteira79/android-skills

Made for: Claude Code, Codex.

Or install android-skills, the plugin that ships this one along with the rest of its 21 skills.

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-annotations

README.md
[![agentmods](https://agentmods.dev/badge/skills/rcosteira79/android-skills/pdf-annotations.svg)](https://agentmods.dev/skills/rcosteira79/android-skills/pdf-annotations)
Your own site
<a href="https://agentmods.dev/skills/rcosteira79/android-skills/pdf-annotations"><img src="https://agentmods.dev/badge/skills/rcosteira79/android-skills/pdf-annotations.svg" alt="Measured on agentmods" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,558 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00141 $0.01558
Opus 5 $0.00071 $0.00779
Sonnet 5 $0.00028 $0.00312
Haiku 4.5 $0.00014 $0.00156

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

Security

Grade A, and why

pdf-annotations 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 6d 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.

plugins/android-skills/skills/pdf-annotations/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Platform PDF annotation & page-object editing

Android can natively edit PDF annotations since API 36.1 — before that the platform story was render-only and the docs still say so: the Jetpack viewer guide's PDF surface is PdfViewerFragment, which explicitly does not support edit mode and hands annotation off to other apps via an android.intent.action.ANNOTATE intent [kb://android/develop/ui/views/layout/pdf/implement-pdf-viewer]. Do not conclude "use a third-party library" for annotation work before applying the version gate below.

The version gate (decide the entry point first)

Two parallel renderers expose the same editing surface (android.graphics.pdf.component):

Entry point Editing available Device requirement
PdfRenderer.Page API 36.1+ platform release
PdfRendererPreV.Page SDK extension 18 API 31+ with the PDF module updated (PreV itself needs extension 13)

Gate at runtime with SdkExtensions.getExtensionVersion(Build.VERSION_CODES.S) [kb://android/guide/sdk-extensions/index]. Extension 18 reaches back to API 31 via mainline updates, so PdfRendererPreV is the branch that covers most devices.

The workflow: open → edit → write

// The fd must be seekable — pipes/sockets are rejected at construction.
ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY).use { fd ->
    PdfRenderer(fd).use { renderer ->                    // or PdfRendererPreV on the ext-18 branch
        renderer.openPage(0).use { page ->
            // Only SUPPORTED annotation types are listed. The pairs are
            // android.util.Pair — NO Kotlin destructuring (no component1/2);
            // read them with .first / .second.
            val existing = page.getPageAnnotations()
            val staleId: Int? = existing.firstOrNull { it.second is FreeTextAnnotation }?.first

            val highlight = HighlightAnnotation(boundsList)   // List<RectF> quads
            val id = page.addPageAnnotation(highlight)
            check(id != -1) { "annotation rejected" }         // add returns -1, it does NOT throw

            highlight.color = newColor
            page.updatePageAnnotation(id, highlight)          // by id -> Boolean success
            staleId?.let { page.removePageAnnotation(it) }    // by id, not list position
        }
        // Write BEFORE close(), to a separate writable fd; the boolean is
        // removePasswordProtection (IOException if true and the doc stays encrypted).
        ParcelFileDescriptor.open(
            dest,
            ParcelFileDescriptor.MODE_READ_WRITE or ParcelFileDescriptor.MODE_CREATE,
        ).use { out ->
            renderer.write(out, false)
        }
    }
}

Read the full file on GitHub · 132 lines

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. 6d ago First seen · 132 lines · 141 tokens per session scan A 567875fd3ca5

Subscribe to this mod's changes

pdf-annotations is a skill published in the GitHub repository rcosteira79/android-skills (136 stars, last pushed 11d ago), licensed MIT. It adds 141 tokens to every session and 1,558 once invoked, about $0.0007 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.