agentleFS
drinkspillerdrinkspiller/skills/pdf-reader/SKILL.md

pdf-reader

Skill1 starsChanged 6 days agoUnlicenseView on GitHub

Read PDF documents from URLs or local paths. Use when asked to read, summarize, or analyze a PDF, paper, or document link. Extracts page-annotated text and renders pages as images for visual understanding of diagrams, figures, and equations.

  • Installs packages

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read PDFs with full text extraction and page rendering for diagrams/figures.

    line 12
  2. Distinctive:

    Prefer using the pre-built binary (available on all gLinux machines):

    line 16
  3. Very specific:

    Use --version to check the build date.

    line 29
  4. Distinctive:

    If you modify the CLI source code, build from source:

    line 32
  5. Very specific:

    After running, use view_file on the rendered page images to inspect diagrams.

    line 47
  6. Very specific:

    Run read_pdf_cli with --url or --file and --output_dir for page images

    line 61
  7. Distinctive:

    Read the text output for content understanding

    line 62
  8. Very specific:

    Use view_file on specific page PNGs listed under RENDERED PAGES for diagrams, figures, or equations

    line 63

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PDF Reader

Read PDFs with full text extraction and page rendering for diagrams/figures.

CLI

Prefer using the pre-built binary (available on all gLinux machines):

PDF_READER=/google/bin/releases/gemini-agents-pdf-reader/read_pdf_cli.par

Alternatively, install via apt (the read_pdf_cli.par binary will be available directly on PATH):

sudo glinux-add-repo -b gemini-agents-pdf-reader stable
sudo apt update && sudo apt install -y gemini-agents-pdf-reader

Use --version to check the build date. To verify the exact build CL: binfs ls /google/bin/releases/gemini-agents-pdf-reader.

If you modify the CLI source code, build from source:

blaze build //learning/gemini/agents/clis/pdf_reader:read_pdf_cli
PDF_READER=blaze-bin/learning/gemini/agents/clis/pdf_reader/read_pdf_cli
$PDF_READER \
  --url=URL \
  --output_dir=DIR \
  --output_file=FILE

The script outputs page-annotated text and renders each page as a PNG image. After running, use view_file on the rendered page images to inspect diagrams.

Library

from google3.learning.gemini.agents.clis.pdf_reader import read_pdf_lib

text = read_pdf_lib.extract_text('/path/to/doc.pdf')
pages = read_pdf_lib.render_pages('/path/to/doc.pdf', '/tmp/output')
output = read_pdf_lib.read_pdf('/path/to/doc.pdf', output_dir='/tmp/output')

Workflow

  1. Run read_pdf_cli with --url or --file and --output_dir for page images
  2. Read the text output for content understanding
  3. Use view_file on specific page PNGs listed under RENDERED PAGES for diagrams, figures, or equations

Flags

FlagDescription
--urlURL to download PDF from
--fileLocal path to PDF file
--pagesPage range (e.g. 1-5,10,15-20). Default: all
--output_dirDirectory for rendered page PNGs
--output_fileWrite text output to file instead of stdout
--dpiRender resolution (default: 200)
--text_onlySkip page rendering
--render_onlySkip text extraction

Reporting Issues

Report bugs or improvements for this skill at Agent Skill: pdf-reader. See the skill_issue skill for instructions on filing and triaging skill bugs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.