Nano PDF Editor

Edit PDFs with natural-language instructions using the nano-pdf CLI.

Nano PDF Editor is a clever CLI tool by Gavriel Cohen that lets you edit PDF slides and documents using plain English instructions. Under the hood, it converts individual PDF pages to images, sends them to Google's Gemini image generation model (the 'Nano Banana' model) along with your natural language edit instructions, receives the edited image back, and stitches everything into the original document. The workflow is surprisingly practical: need to update a revenue chart on slide 5? Just run `nano-pdf edit deck.pdf 5 'Update the revenue chart to show Q3 at $2.5M'`. Want to add a new summary slide? `nano-pdf add deck.pdf 15 'Create an executive summary slide with 5 bullet points'`. The model understands document layouts, chart types, text formatting, and design patterns well enough to make coherent edits. Key features include parallel multi-page editing (edit several slides simultaneously), Google Search integration (the model can look up current data while editing), style matching for new slides (added pages inherit the deck's visual style), and text layer preservation so edited PDFs remain searchable and copy-pasteable. The tool hit #1 on Hacker News Show HN with 176 points, resonating with anyone who's ever needed to make 'just one quick change' to a presentation but had to dig up the source file. It's built in Python and installed via `uv tool install nano-pdf`. Limitations are real: it's image-based editing, so very precise text changes may introduce rendering artifacts. It works best for visual edits (charts, layouts, design elements) rather than precise text corrections. And since it uses Gemini's API, you need a GEMINI_API_KEY. Best suited for: quick presentation edits when you don't have the source file, updating charts and visuals in decks, adding new slides that match existing style, anyone who hates opening PowerPoint for a single change.

Tags: pdf, editor, document, utility

Category: Utility

Use Cases

  • Quick deck fixes: update a single chart or stat without finding the source file
  • Add new slides to an existing presentation matching its style
  • Update branding elements across multiple slides in parallel
  • Fix typos or outdated information in PDF reports
  • Create presentation variations for different audiences
  • Batch-update quarterly numbers across a deck

Tips

  • Use for visual edits (charts, layouts, design) rather than precise text corrections
  • Edit multiple pages in parallel for faster batch updates
  • The model can look up current data via Google Search — ask it to update stats with real numbers
  • New slides inherit the deck's visual style — describe content, not design
  • Always keep a backup of the original PDF before editing
  • Be specific in prompts: 'Change the bar chart title to Q3 Results' beats 'update the chart'
  • Pair with nano-banana-pro for generating images to insert into presentations

Known Issues & Gotchas

  • Requires GEMINI_API_KEY — the tool uses Gemini's image generation model
  • Edits are image-based: the page is rasterized, edited as an image, then re-inserted — some fidelity loss is inevitable
  • Text-heavy precise corrections may introduce rendering artifacts — best for visual/layout edits
  • The text layer preservation is best-effort — complex PDFs may lose some text selectability
  • Requires `uv` (fast Python package manager) for installation
  • Large PDFs with many pages will consume more API calls when editing in parallel
  • Google's safety filters may block edits that involve certain content types

Alternatives

  • Adobe Acrobat CLI
  • QPDF / pdftk
  • LibreOffice CLI (soffice)
  • ChatGPT Canvas / Artifacts

Community Feedback

The tool converts the page you want to edit into an image, sends it to the model API together with your prompt to generate an edited image, then converts the updated image back and stitches into the original document.

— Hacker News (Show HN)

Edit any PDF using Natural Language in Seconds with Nano Banana. I will show you how you can edit any PDF file, regardless of its formatting, with a few simple prompts.

— Medium (Codex)

Edit PDF documents using natural language instructions with the Nano PDF Editor skill. Automate page-specific edits, fix typos, update charts, and add new slides.

— MCP Market

Configuration Examples

Install nano-pdf

# Install uv first
brew install uv

# Install nano-pdf
uv tool install nano-pdf

# Set Gemini API key
export GEMINI_API_KEY="your-key-here"

Edit a specific page

# Update a chart on page 5
nano-pdf edit deck.pdf 5 "Update the revenue chart to show Q3 at $2.5M"

# Fix a typo on page 2
nano-pdf edit report.pdf 2 "Change 'Fiscal Year 2025' to 'Fiscal Year 2026'"

Add new slides

# Add an executive summary after page 1
nano-pdf add deck.pdf 1 "Create an executive summary slide with 5 key bullet points about Q3 performance"

# Add a closing slide at the end
nano-pdf add deck.pdf 20 "Create a closing slide with 'Thank You' and contact information"

Installation

uv tool install nano-pdf

Homepage: https://pypi.org/project/nano-pdf/

Source: bundled