51

Show HN: Filling PDF forms with AI using client-side tool calling

Hey HN!

I built SimplePDF Copilot: an AI assistant that can interact with the PDF editor. It fills fields, answers questions, focuses on a specific field, adds fields, deletes pages, and so on.

It's built on top of SimplePDF that I started 7 years ago, pioneering privacy-respecting client-side pdf editing, now used monthly by 200k+ people.

As for the privacy model: the PDF itself never leaves the browser. Parsing, rendering, and field detection all run client-side.

The text the model needs (and your messages) goes to whatever LLM you point at. By default that's our demo proxy (DeepSeek V4 Flash, rate-capped), but you can BYOK and point it at any cloud provider, or go fully local (I've been testing with LM Studio).

Unlike the existing "Chat with PDF" tools that only retrieve the text/OCR layer, Copilot can act on the PDF: filling fields, adding fields (detected client-side using CommonForms by Joe Barrow [1], jbarrow on HN with some post-processing heuristics I added on top), focusing on fields, deleting pages, and so on.

I built this because SimplePDF is mostly used by healthcare customers where document privacy is paramount, and I wanted an AI experience that didn't require shipping PII to a third party. Stack is pretty standard:

- Tanstack Start

- AI SDK from Vercel

- Tailwind (I personally prefer CSS modules, I'm old-school but the goal since I open source it, I figured that Tailwind would be a better fit)

The more interesting part is the client-side tool calling: events are passed back and forth via iframe postMessage.

If you're not familiar with "tool calling" and "client-side tool calling", a quick primer:

Tool calling is what LLMs use to take actions. When Claude runs grep or ls, or hits an MCP server, those are tool calls.

Client-side tool calling means the intent to call a tool comes from the LLM, but the execution happens in the browser.

That matters for: speed, you can't go faster than client-to-client operations and also gives you the ability to limit the data you expose to the LLM. For the demo I do feed the content of the document to the LLM, but that connection could be severed as simply as removing the tool that exposes the content data.

The demo is fully open source, available on Github [2] and the demo is the same as the link of this post [3]

What's not open source is SimplePDF itself (loaded as the iframe).

I could talk on and on about this, let me know if you have any questions, anything goes!

[1] https://github.com/jbarrow/commonforms

[2] https://github.com/SimplePDF/simplepdf-embed/tree/main/copil...

[3] https://copilot.simplepdf.com/?share=a7d00ad073c75a75d493228...

Might be worth making it clearer that the chat messages are going to a remote server. So any PII data is leaving the local machine.

a day agoiamflimflam1

I tried to make it clear with the popup message that appears when you start chatting: "Public demo. Use sample data only. Messages are processed by the selected AI provider."

But you're right that it's not as evident as I wanted to, I'm making a small copy update to make it clearer: "Public demo. Your chat messages leave your device and are sent to the selected AI provider. Use sample data only."

(Since there's support for local models, the popup is only displayed when NOT using your own model)

Thanks!

EDIT: the copy update is live, thanks again!

a day agonip

Embed a small llm with wasm so it's all private. Maybe make an api so when the os has a local llm it will use that eventually

15 hours agowhattheheckheck

[dead]

2 hours agonip

Just to be clear, this is a technical demo showing what's possible with client-side tool calling + local models: LLM-assisted form filling where no document data has to leave the user's machine.

Use cases range from:

- Filling foreign-language forms

- Navigating a contract before signing: "can I trust ALL the clauses here?"

- Pre-filling repetitive forms from existing data sources (CRM, EHR, etc. via MCP/RAG)

Copilot is designed to be embedded; our customers ship it white-labeled inside their own products.

a day agonip

Do you think this will work with Chrome's built-in AI [1]? [1] https://developer.chrome.com/docs/ai/built-in

17 hours agokassenov

It already does! More specifically, SimplePDF supports "WebMCP": the tools that the LLM is using are exposed as WebMCP tools

16 hours agonip

In the chat box I typed my SSN is "123-45-6789". It filled it in in the wrong box (4 Exemptions).

What problem is this solving? Isn't it easy enough to just click in the correct box and type the values?

How does this compare to Claude Cowork?

20 hours agograssfedgeek

Thanks! You caught a real bug: the form labels fed to the LLM were mangled. Now fixed: values land in the correct field.

On "what are we trying to solve":

Forms (PDFs, scanned paper) are still everywhere and aren't going away. SimplePDF Copilot exists to make the transition less painful. A few concrete use cases:

- Pre-filling repetitive forms from existing data sources (CRM, EHR, etc. via MCP/RAG). In most industries, employees fill forms by copy-pasting or retyping. With AI + tool calling, most of the form arrives pre-filled and the employee just corrects or adds the missing bits.

- Filling foreign-language forms. If you've moved to a new country, or know someone who has, you've had to fill out forms in a language you don't master.

- Understanding a contract before signing it. "Can I actually trust all the clauses here?" Reading proficiency changed the world by giving people a way to understand what they were signing. This extends it to legalese and odd clauses.

On Claude Cowork:

Different shape, and a different privacy model. Cowork drives a sandboxed virtual desktop: you can't see exactly what it's doing while it fills, and correcting a wrong value means another back-and-forth with the LLM.

Copilot works inside your editor: every change is visible as it happens, you can amend any field with one click, and the document never leaves your browser + it's LLM agnostic: bring your own (local or hosted).

24 minutes agonip

I think the demo LLM is quite small and perhaps too dumb

4 hours agoTepix

One thing I've struggled with before is building a collection of data models based off of a collection of PDF forms.

I wanted to abstract away the PDF form building my own html form on top of a data model that can later be used to programmatically fill the PDF .

Since I had 100s of PDFs, I wanted an OCR+LLM pipeline to build a data model for each PDF. Unfortunately, OCR + LLM works ~90% of the time but sometimes fields are missed or mislabeled in the data model.

Does this sometimes get it wrong during programmatic filling? How do you deal with that?

a day agonilirl

[dead]

a day agonip

I managed to do this locally with Claude and some python libraries. Claude looked over the PDF, found the fields, and wrote a python script to insert data at the appropriate locations. Sure it took some futzing to get everything to line up properly, but as other's have said, my PDF wasn't sent to a remote server

16 hours agos09dfhks

Keep going though. I’m definitely looking for something like this once we can get something secure we can use with proprietary and pii data.

a day agograhammccain

This is the canonical use case for Tinfoil: https://tinfoil.sh/inference. It provides verifiably private AI inference with frontier open source models: https://docs.tinfoil.sh/models/overview

Disclaimer I'm the cofounder, only recommending it because it's legitimately the right shape for your problem. The idea is that the model runs inside a secure enclave (using NVIDIA confidential computing), and the enclave code is open source and is verified via remote attestation upon connection: https://docs.tinfoil.sh/verification/verification-in-tinfoil

a day agoFrasiertheLion

This looks interesting, I’m looking for a good personal PDF editor that I can use in windows and private.

Seems like your product is more for organizations, any idea if such a thing exists. It seems like the market is full of bloated (Adobe/foxit) or not properly working editors.

20 hours agoBloondAndDoom

We offer both:

- A privacy-focused PDF editor, free for individuals, used by 200k users monthly: https://simplepdf.com/editor

- The same editor, embeddable into one’s app for companies, with the same privacy guarantees (everything happens in the browser) + the resulting PDF is stored in their own storage (« bring your own storage »).

The majority of our paid customers are in healthcare where privacy is non-negotiable. Co-pilot extends that to the AI world (« bring your own AI »)

What are you using the PDF editor for?

19 hours agonip

I hope this doesn't sound insulting but how is this different than Preview or Adobe Acrobat?

17 hours agotrollbridge

Absolutely not insulting! In fact an excellent question!

Preview was an inspiration when I started SimplePDF, my goal was to make the "Preview" of the web, so that people without a Mac would benefit from a software matching Preview in ease of use and overall polish.

Adobe Acrobat: SimplePDF has "Simple" in the name as the philosophy is to keep it simple (both in ease of use, and features): I don't intend to support everything that Adobe Acrobat does. There's a lot of features that I could build that I intentionally do not, as they would bloat the UI and hard the overall usability. Most people have very simple needs and don't need advanced features (like scripting, etc).

16 hours agonip

It is cool, but the demo is flawed, right at the second field:

  What's the business name/disregarded entity name, if different from above (line 2)?
As far as I can tell, no way to skip this, leave it empty, not even "use a space". And that field would be empty for many or most.
a day agotyingq

Have you tried telling the LLM to just skip the field and move to the next one?

I tried with various: "Skip it", "None, leave blank", "Skip this field" and all worked for me, but if may very well be missing something very obvious?

a day agonip

That would have occured to me if it were free-form chat, but it's guided and telling me to input the value, not a chat response. Unable to try, third round hits the demo limit.

a day agotyingq

I was not able to reproduce it, so I made a small video, hopefully I better understand your problem once you've seen it: https://cdn.simplepdf.com/simple-pdf/assets/hn-reply-tyingq....

In the video I let the chat fill my name, then have it skip the second field (business), then fill LLC, it makes a mistake and I correct it

21 hours agonip

It looks cool but, how is this different from me uploading to chatgpt and asking it to fill in?

a day agosimianwords

[dead]

a day agonip

Does it support XFA forms?

a day agokiney

Hey Kiney!

It supports AcroForms (like in the example) but not XFA.

Why are you asking? gov forms support?

a day agonip

[flagged]

a day agoajaystream

[dead]

18 hours agoCalmBirch127

[dead]