Skip to content
Web and mobile apps August 13, 2026

On-device document generation: fast, cheap and secure

Generating PDF reports, invoices, protocols or exports is one of the most common requirements for business apps. Most solutions send documents off to a server for processing, and costs grow right along with the number of users. In this article, we show a different approach: processing documents directly on the user's device, which scales on its own and costs you no server compute.

Summary

  • Documents can be generated and processed directly in the browser or mobile app, with no data sent to a server.
  • Every user "brings" their own compute power, so the solution scales without you expanding infrastructure.
  • Sensitive data never has to leave the device, which anyone dealing with GDPR or stricter corporate security policies will appreciate.
  • Even a report hundreds of pages long builds smoothly in the background – the app doesn't freeze and the user can keep working.
  • For extremely large files or OCR, we design hybrid solutions: the client handles routine traffic, the server only the exceptions.

Two approaches to processing documents

When an app needs to generate a document or process a larger volume of data, there are two routes to take.

Server-side processing

  • Ongoing cost – you pay for compute per user and per document
  • Peaks – deadline rushes require over-provisioned capacity
  • Waiting – data travels to the server and back
  • Data in transit – sensitive documents leave the device

On-device processing

  • Free compute – supplied by the user's own device
  • Instant result – no waiting on a round trip
  • Offline in mobile and desktop apps – processing runs even without an internet connection
  • Data stays with the user – nothing leaves the device

Important: Today's phones and computers have compute power that used to be reserved for servers. For most business documents, on-device processing isn't just possible – it's substantially cheaper.

What this means for the project budget

With server-side processing, you pay more with every user and every document, continuously, month after month. With on-device processing, only the upfront development is more demanding; generating the documents themselves then costs nothing at all.

Scaling for free

A thousand users means a thousand processors, not a thousand-fold cloud bill.

No peak loads

A month-end deadline rush doesn't slow the system down – every export runs on its own user's device.

Simpler infrastructure

Fewer server components means less maintenance and fewer places where something can fail.

How we build it

We build client-side processing on two techniques: demanding work runs separately in the background, and data is pre-processed and optimized before generation.

Background processing: the app stays smooth

The most common worry about on-device processing is: won't the app freeze while it generates a report hundreds of pages long?

It would, if the computation ran on the same thread as the user interface. That's why we separate demanding processing into its own thread that works independently of the screen:

  • the user interface stays smooth, and the user can keep working
  • the background thread assembles the document, processes data, or compresses files
  • an error during processing doesn't affect the rest of the app

In a web app, that kind of thread requires its own code, which we prepare in optimized form already at build time. The browser then handles tasks that would otherwise belong on a server:

  • generating multi-page PDFs, including charts, tables and photos
  • processing thousands of records into summary reports

Chunked processing: speed even at scale

The second challenge is data volume. Before generation, we pre-process and optimize both the data and the document layout: records are grouped into the batches that process most efficiently, whether that's table rows, images, or charts, and the document is assembled from them piece by piece. Generation time then scales linearly with the amount of data, and an export with thousands of records comes together just as smoothly as one with ten rows.

Data security and privacy

Business documents often contain personal data, prices, or internal information. With on-device processing, data doesn't have to leave the user's phone or browser at all. Only what genuinely belongs there gets sent to the server.

That simplifies GDPR compliance and fits stricter security policies where moving documents off company devices is undesirable.

The safest data transfer is the one that never happens.

When on-device processing isn't enough

Client-side processing isn't dogma – we use it where it makes sense. The server is the right place for tasks the user's device genuinely can't handle, or that require centralized resources:

  • OCR and document extraction. Recognizing text from scans and machine-processing content.
  • Bulk overnight jobs. Generating thousands of documents with no user present.
  • Archiving and long-term storage. Centralized storage with controlled access.
  • Very low-powered devices. Older phones with limited memory.

In such cases, we choose a hybrid solution: the user's device handles routine traffic, and the server takes only the exceptional and bulk tasks. That way, you pay for servers only where they're genuinely needed.

Important: The right question isn't "client, or server?" but "which task belongs where?" A well-designed app combines both, so operations stay as cheap as possible and responses stay as fast as possible.

What to think about when designing it

To make sure everything works reliably for every user, we keep a few areas in mind during design:

  • Browser memory. Every browser and phone has a different ceiling; a large export must not exceed it, or the system will kill the tab without warning.
  • Interrupted processing. A user may close the tab, or the system may suspend the app mid-task; longer operations therefore need to resume safely.
  • Large input data sets. You can only process what's already on the device. We therefore sync data continuously, in small changes, so an export doesn't need to download anything large and can start instantly.
  • Differences between devices. We test the solution from high-end computers down to ordinary mobile phones.
  • Multiple languages and special characters. Documents render diacritics, different alphabets and technical symbols correctly, regardless of which fonts are installed on the user's device.

From our practice

Reports and exports in PatrolControl

We use this approach in PatrolControl, the security patrol management portal we built for our client DOBRÁ AGENTURA. The system processes 3 million events a day from attendance, shifts and security incidents, and dispatchers continuously need reports and exports from it for both clients and internal records.

PatrolControl – portal

Security systems – DOBRÁ AGENTURA

PatrolControl – portal

Reports on attendance, shifts and security events, along with bulk exports, are assembled directly in the dispatcher's browser. The server never has to generate documents for each user individually and only handles running the portal itself.

We'll build you an app whose costs won't grow with your user count

Where documents get processed is an architectural decision. It gets made at the start of a project and is expensive to change later. We build web and mobile apps that generate reports, invoices, protocols and exports directly on the user's device: fast, secure, and with no ongoing payments for server compute.

Get in touch and we'll provide a free consultation. We'll design a solution around your project, including a hybrid architecture wherever the data calls for one.

Discuss your project
Back to blog