PaperPilot – Zero-Cloud, Pure-Rust PDF Engine with WASM and MCP
j / k
|
Down or up a comment |
h / l
|
Previous or next link |
?
|
This help |
One Google search (yeah I'm old, sorry, nobody "Googles" anymore) for "rust pdf library" shows this. Yet people now redo and redo and redo everything again just to have "their" semi-broken copy of a HTML -> PDF renderer (and then run into the same edge cases that were already fixed before). There are lots of edge cases in typography especially, I recently had a lot of fixes as I was trying to ocr-and-cleanup a 1732 scan of some books with Claude auto-extracting the font. There were a ton of edge cases in the layout, esp. related to column, footnote and sidebar handling, or things like "Hebrew RTL text accidentally disappears if text breaks weirdly", "1-bit image compression", etc.
I have nothing against AI, I use it heavily myself, but what is annoying is people completely ignoring the years of work of existing projects that do the exact same thing - instead of just forking, but instead re-tokenizing the exact same work again. Most likely the author didn't research "does this already exist" and that's annoying, then you get 100 of similar projects reinventing the world with tokens again and again. Sometimes its beneficial and can lead to faster exploration of new approaches, but in most cases its not and misses edge cases that were solved before.
It seems like fschutt/printpdf is your project. You should definitely at least disclose it in your comment, if that's the case.
When we evaluated the Rust PDF landscape, printpdf was actually one of the first crates we looked at for PDF generation. The reason we opted for a stack centered around lopdf and pdf-writer was architectural: PaperPilot's primary focus is heavy manipulation and non-destructive AST transformation of existing, arbitrary, often malformed real-world PDFs (re-ordering cross-reference tables, granular /P permission bitmask hashing, raw object streams, page imposition, booklet folding, and outline splitting).
For document synthesis (HTML/Markdown to PDF), typography and edge-cases (like the RTL/footnote issues you mentioned) are notoriously hard, and we'd love to learn from or collaborate with printpdf's battle-tested approaches there. Thank you for the feedback and all your contributions to Rust's PDF ecosystem!
> Strategic Vision: Evolve PaperPilot from a best-in-class PDF workstation into the Universal Document Operating System for humans and AI agents. [2]
[1] https://github.com/KrushnaVardhanReddy/PaperPilot/blob/main/...
[2] https://github.com/KrushnaVardhanReddy/PaperPilot/blob/main/...
I explicitly start most programming projects with a request for existing libraries and explicit instructions to the model to prefer using them and keep our logic exclusively to what we need beyond that.
People are forgetting and/or don't realize that just because the actual generation is zero cost does not mean the code is zero cost. Every line of bespoke code is a liability. Every piece of duplicative software you produce for no reason other than "this one is mine" is polluting the ecosystem and creating a noisy landscape in which such problems will just get worse. We are seeing the complete erosion of collective contribution models which has negative implications for the collective maintenance and enhancement of shared knowledge over time.
Maybe that's your answer. Search is so bad and LLM so good that it's faster and easier to re-implement than reuse.
The only thing that slows down the new paradigm is the apparent requirement of posting the output to HN so others will find it.
That irony is not lost on me.
This is a scary level of AI mania.
Even if you're being assisted by the best frontier model, there is no way that reimplementing a PDF engine from scratch is faster than just using the one that's already there. AI-driven coding still takes time and tokens. A web search takes maybe 60 seconds to search and find the existing implementations?
You could even tell the LLM to configure (or even fork) one of the existing implementations for you, and that would still be way faster than a from-scratch implementation.
I use AI heavily but it's not this omnipresent deity that knows everything at all times.
The first project you linked explicitly calls out broken pdf handling.
I see the outbreak of PDF readers, AI TUI harnesses, etc.
Can I get some of those free tokens you’re having?
In the last 5 days alone I've had the equivalent of 2+ years of ChatGPT Plus Codex quota given for free via resets. I literally leave my PC running in Codex with 8+ Sol 6.1 Max sessions jamming away most of the day writing a desktop environment from scratch (and other things) just because the reset tokens will evaporate if I don't use them. I've even had days with > 1 billion tokens used where it was reset by the morning.
That said, who knows what free ride will appear with AI capital next month!
After all, a year ago and doing these same tasks would just fall on its face. The hard part of the problem is solved, now it's not even "do LLMs continue to get better" but "do LlMs keep getting cheaper".
Nothing surprising here; pre-2022/2023, Rust was used primarily for rewriting things (compared to, for example, Go, which was used to write new things, not replacements).
I don't find it surprising that the pattern is continuing.
It's not that Rust or Go aren't used to write new things, it's just that the bar for reaching the HN front page with new things is much higher than for mere copycats.
[1]: https://hn.algolia.com/?q=written+in+Go
How could you possibly know this, for either languages?
FWIW, I've only worked and written greenfield software with Rust, and have only worked professionally with Golang to replace existing services. I'm sure I'm not alone in this, nor in the complete opposite. But I don't think either of us could say how either of the languages or "primarily used", that's a bit too much.
But... Rewrite-it-in-Rust is a meme, while rewrite in Go is not.
I'm glad you got the gist of my comment :)
> But... Rewrite-it-in-Rust is a meme, while rewrite in Go is not.
Today no, but it definitely was when it first became popular, "X but in Go" was fairly common on the HN frontpage and elsewhere. Just like "X but in Ruby" used to be a thing too, but isn't anymore.
I just ran an security analysis on the repo. As is, it's not looking great (again nothing against vibe/agentic coded projects) the lack of security consideration is astonishing (not suggesting a malice). Definitely NOT production ready.
Like this case, the open source project here could be used as a base for further development by AI!
If it is you should disclose it and the license should be AGPLv3 instead of Apache.
The core PDF parsing and AST manipulation is built on pure Rust libraries: lopdf (0.45), pdf-writer, hayro, and image. All of these are Apache 2.0 or MIT licensed.
Any mention of MuPDF in the documentation/planning notes was strictly part of an architectural trade-off analysis (evaluating existing Python/C extraction pipelines like PyMuPDF vs. pure Rust). The entire crate stack in paperpilot-pdf is 100% Apache 2.0 / MIT clean.
Seriously though, can you list some examples?
I like to check out everyone's first commits :)
Asking because I've recenly been doing something similar, but since my typst files are templates, which with the same inputs can differ and may need different translations as well, I've written a small i18n library in typst (but I guess you could require a set of translations to be present with a given typst file as well).
It runs in the browser, is private and no-fuss. You can also host it locally if you like.
i'm not convinced a human has ever actually looked at this project; this must be the work of someone's overzealous openclaw agent or something.
First, how do you "sign" a PDF using this tool?
If you're going to build this, can you find a small, even tiny model that has decent tool calling and, effectively turn that in combination with this tool into a single HTML page that I can use everywhere?
Literally something I could save on a work laptop or cloud desktop and would actually work (even if it would be slow, it'd still be a great improvement)
""" I built PaperPilot because I was frustrated by the privacy trade-offs of modern PDF utilities.
Whenever you need to split, merge, compress, or sign a confidential document (tax forms, legal contracts, medical paperwork) using online tools, your files are transmitted to a third-party server. Most "free" tools retain copies or run in closed-source cloud environments.
PaperPilot is a 100% zero-cloud, local-first engine written in pure Rust (built on top of lopdf, pdf-writer, and image). 0 bytes are ever sent to an external server.
Key aspects of the project:
1. Penta-Interface Architecture: Instead of building just another web app or CLI, the same core Rust operations run across 5 surfaces: - Terminal CLI: High-throughput local processing and bash scripting. - Local Desktop App: Native cross-platform GUI built with Tauri 2 and Svelte 5. - Client-Side Web: Runs 100% inside your browser via WebAssembly (https://usepaperpilot.com/). - REST / Gateway API: Standalone local daemon (localhost:7823) for local microservices. - Model Context Protocol (MCP): Connects local AI agents (Claude Desktop, Cursor, OpenCode) directly to local PDF tools so LLMs can inspect, redact, and sign PDFs on disk without cloud upload.
2. Capabilities (75+ Tools): - Standard operations: Merge, split, rotate, reorder, burst, booklet imposition, and N-up grid. - Privacy & Compliance: Local PII regex redaction (SSNs, cards, emails), metadata striping, and digital signature verification. - Document Extraction: PDF to structured Markdown tables (no coordinate loss), PDF to JSON, and pure-Rust layout analysis. - Offline RAG: Embedded vector store (libsql_vector) with an actionable visual citation canvas.
3. Performance & License: - Average operation latency is ~20ms to 130ms. - 100% Free and Open Source under the Apache 2.0 license.
The GitHub repository is at https://github.com/KrushnaVardhanReddy/PaperPilot and the browser-based WASM sandbox is live at https://usepaperpilot.com/.
I’d love to hear your feedback on the architecture, performance benchmarks, and any edge-case PDF formats we should test against! """
Which reads very much LLM produced.
That's not native, and if you pointed it out to the LLM that wrote this, it would agree. It's just dumb so it didn't think of the fact that that's entirely the wrong term.
Really. All he wants was very easy to do already.
I think you've missed this part:
> Terminal CLI: High-throughput local processing and bash scripting.
I am interested in the following use case: convert the PDF to e-pub, then edit it with Calibre to fix some issues that always happen.
Currently using pandoc.
I built PaperPilot because I was frustrated by the privacy trade-offs of modern PDF utilities.
Whenever you need to split, merge, compress, or sign a confidential document (tax forms, legal contracts, medical paperwork) using online tools, your files are transmitted to a third-party server. Most "free" tools retain copies or run in closed-source cloud environments.
PaperPilot is a 100% zero-cloud, local-first engine written in pure Rust (built on top of lopdf, pdf-writer, and image). 0 bytes are ever sent to an external server.
Key aspects of the project:
1. Penta-Interface Architecture: Instead of building just another web app or CLI, the same core Rust operations run across 5 surfaces: - Terminal CLI: High-throughput local processing and bash scripting. - Local Desktop App: Native cross-platform GUI built with Tauri 2 and Svelte 5. - Client-Side Web: Runs 100% inside your browser via WebAssembly (https://usepaperpilot.com/). - REST / Gateway API: Standalone local daemon (localhost:7823) for local microservices. - Model Context Protocol (MCP): Connects local AI agents (Claude Desktop, Cursor, OpenCode) directly to local PDF tools so LLMs can inspect, redact, and sign PDFs on disk without cloud upload.
2. Capabilities (75+ Tools): - Standard operations: Merge, split, rotate, reorder, burst, booklet imposition, and N-up grid. - Privacy & Compliance: Local PII regex redaction (SSNs, cards, emails), metadata striping, and digital signature verification. - Document Extraction: PDF to structured Markdown tables (no coordinate loss), PDF to JSON, and pure-Rust layout analysis. - Offline RAG: Embedded vector store (libsql_vector) with an actionable visual citation canvas.
3. Performance & License: - Average operation latency is ~20ms to 130ms. - 100% Free and Open Source under the Apache 2.0 license.
The GitHub repository is at https://github.com/KrushnaVardhanReddy/PaperPilot and the browser-based WASM sandbox is live at https://usepaperpilot.com/.
I’d love to hear your feedback on the architecture, performance benchmarks, and any edge-case PDF formats we should test against!
https://moooff.github.io/HermitUI/hermit-agent/
So this Tool comes in very handy and will try to integrate it.
Question: seemingly you’re using Antigravity, an harness not many use. Please tell use about the choice of LLM and your experience with it.
Having a strict test-first harness where every PR has to run against real PDF byte fixtures (zero mocks) and compile across CLI, WASM, and MCP kept the codebase consistent even when moving fast.
Are you using Antigravity IDE v2.5.5 that hasn't been updated since 2026-08-13 and that supports 3 legacy models + Gemini Flash 3.8? I assume you're using Gemini Flash 3.8?
[0] https://news.ycombinator.com/item?id=44034918 [1] https://news.ycombinator.com/item?id=44813854