←back to thread

176 points GavCo | 1 comments | | HN request time: 0s | source

The new Gemini 3 Pro Image model (aka Nano Banana) is incredible at generating slides, so I thought it would be fun to build a CLI tool that lets you edit PDF presentations using plain English. 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.

Examples:

- `nano-pdf edit deck.pdf 5 "Update the revenue chart to show Q3 at $2.5M"`

- `nano-pdf add deck.pdf 15 "Create an executive summary slide with 5 bullet points"`

Features:

- Edit multiple pages in parallel

- Add entirely new slides that match your deck's style

- Google Search enabled by default so the model can look up current data

- Preserves text layer for copy/paste and search

It can work with any kind of PDF but I expect it would be most useful for a quick edit to a deck or something similar.

GitHub: https://github.com/gavrielc/Nano-PDF

Show context
mentalgear ◴[] No.46090944[source]
Nice - but consider adding an animated screengrap like: https://github.com/pythops/oryx
replies(1): >>46091501 #
yoavm ◴[] No.46091501[source]
Please don't add an animated gif to your README. Nothing worse than an autoplaying video with no controls, that has 10 frames but takes 5.4MB to download. Github supports normal video files. It allows the user to rewind or pause, and it results in a much smaller file size.
replies(1): >>46092202 #
varenc ◴[] No.46092202[source]
Generally agreed! though fun point of info: you can use the .avif format to get something that behaves just like a gif (auto-playing, no sound, no controls) but supports modern features (HDR/transparency channel) and is compressed as well as a modern video is, since its just AV1. And it's supported in most all modern browsers these days: https://caniuse.com/?search=avif
replies(1): >>46094424 #
ornornor ◴[] No.46094424[source]
I tend to use webm but I’m curious, is avif better (performance, size) for gif?
replies(1): >>46099396 #
varenc ◴[] No.46099396[source]
Webm is better in many ways, but it doesn't give you gif-like behavior I think. As in, you can't just include it in an <img> tag and a get an autoplaying looping video. Though you can simulate it with <video>.

Basically, .avif is an "animated image" format, like .gif, but .webm is only a video format.

edit: just realized .webp i think can be an animated image! So that seems like the alternative

replies(1): >>46099876 #
1. ornornor ◴[] No.46099876[source]
Thanks