Show HN: Nano PDF – A CLI Tool to Edit PDFs with Gemini's Nano Banana

172 points - last Saturday at 8:44 PM


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

Source

Comments

tecoholic last Saturday at 9:32 PM
> Converts an image to a single-page PDF with a hidden text layer using Tesseract. This is the 'State Preservation' step.

Does this mean the text only pdf page is transformed into an image that covers the full page, but the text is still under there. So, any machine based extraction would still get the text, but would probably loose all the bounding box information and regular users cannot just use their mouse to select text anymore?

lxe last Saturday at 9:03 PM
This is nuts and I absolutely love this. So you convert the PDF into image, edit the image, then convert the image back into a PDF.
shevis last Saturday at 9:59 PM
A side effect of replacing entire pages with images is that the file size will expand dramatically. Most PDFs only contain a couple of images
moezd last Sunday at 6:50 AM
Behold, the might of LLMs! Instead of ushering the age of AGI as advertised 6 months ago, now it cleans your PDFs for you.

Many thanks to humanity for failing to standardise PDF and this project for paying interest on that tech debt with datacenter levels of energy consumption.

struc_so yesterday at 4:07 AM
Interesting approach. I've spent a lot of time wrangling PDF internals recently, and the issue is usually maintaining the xref table integrity when you inject new content streams.

Does this approach rewrite the entire file structure on save, or are you appending incremental updates to the EOF? Incremental is safer for corruption, but file size bloats quickly with AI-generated diffs.

treetalker last Saturday at 9:12 PM
I'd love to see clearer examples: a video, or original pdf / command / result pdf. Very cool!
perfectritone last Sunday at 2:23 AM
It's incredible how many hacks there are to make PDFs semi-usable.
ohans yesterday at 3:19 PM
Really cool! I reckon a nice UI would be a good addition
itsmevictor last Saturday at 9:26 PM
Very nice! I wonder whether that could be used to get LLMs to annotate pdfs. Say an "agentic" CLI like Claude Code or Gemini-cli reviews a pdf and finds typos, could it use this to annotate the pdf like underlining them in red or something of that sort? That could be nice.
mentalgear last Saturday at 9:27 PM
Nice - but consider adding an animated screengrap like: https://github.com/pythops/oryx
iamflimflam1 last Sunday at 3:31 AM
The lack of examples makes me very reluctant to commit any time to trying this out - despite it being something that I’m interested in.

Has anyone given any it a go? Does it work?

ThrowawayTestr last Saturday at 9:56 PM
I recently tried to change a single word in a PDF and nearly tore my hair out (thank you LibreOffice) I'll definitely keep this in mind for next time, thank you.
McNulty2 last Sunday at 12:59 AM
I like the example of updating latest market data. Updating a deck one-off is tedious. Keeping it updated long-term was never going to happen. But now it can
toddmorey last Sunday at 1:03 AM
I thought it was kinda funny that Google Slide’s own built in “beautify this slide” button converts the whole slide into an uneditable image.
mlpoknbji last Sunday at 12:01 AM
Somewhat unrelated but can anyone recommend a way to edit the text of a PDF using LLM? Something like AI + acrobat pro?
vood last Sunday at 6:38 AM
Congratulations on the release; that's a really good job.
informal007 last Sunday at 1:37 AM
it will be more excited if i can use this feature in application with GUI, it’s now convenient to check the result after edit the PDF, i need to transfer between CLI and PDF reader
John7878781 last Saturday at 10:23 PM
Love this.

After several iterations of edits, would the image quality decrease?

Zopieux last Sunday at 2:27 PM
I am disappointed that this doesn't modify the underlying pdf structure (which is a horror show, I know) but instead relies on fairly lossy OCR back&fourths.

I wish an agent with a validation and rendering tools could instead manipulate the structure to accomplish those edits way less destructively, checking its progress with the tools.

mertleee last Sunday at 1:14 AM
[dead]
sultson last Saturday at 9:17 PM
[dead]