Skip to content

A local-first PDF toolkit built on Nuxt and OPFS

Published

beePDF processes PDFs entirely in the browser, keeping document bytes in the origin private file system, metadata and thumbnails in IndexedDB, and processing work in Web Workers. Developer eoinmcg described it as a 100% client-side Progressive Web App that uploads no documents to a remote server in a dev.to build report published on 2026-10-06 (the report).

Uploading a PDF requires trusting the service that processes it. It says mainstream tools, naming Smallpdf and ILovePDF, ask the user to upload the sensitive document to their remote server, and that even when services use encryption in transit and promise to delete files after a limited period, uploading confidential documents to a remote server still means entrusting those documents to a third-party service. Its own summary of the distinction is that encryption in transit protects the transfer and does not eliminate the need to trust the system that receives and processes the document. It adds that depending on the type of files and the use case, giving legal and medical as its examples, uploading them to a third-party service may not be an option due to privacy, confidentiality, or regulatory requirements (the report).

The framework is Nuxt, which it annotates Vue 4, TypeScript, Vite. PWA and offline support come from @vite-pwa/nuxt plus Service Workers. In-memory file processing uses pdf-lib, PDF.js, and the native Canvas API. Local persistence is the origin private file system, which the report reaches through navigator.storage.getDirectory(). Styling and UI are Pico CSS (the report).

It describes StorageManager.getDirectory() as the method used to obtain a reference to a FileSystemDirectoryHandle object allowing access to a directory and its contents, stored in the origin private file system, and states that it returns a promise fulfilling with that handle. MDN also documents two ways the call can fail: a SecurityError thrown if the browser is not able to map the requested directory to the local OPFS, for example due to storage or memory constraints, and which some browsers also throw if getDirectory() is called in private browsing mode, and an UnknownError thrown in some browsers in private browsing mode (MDN, StorageManager.getDirectory()).

Why the report rejects the other storage options

Section titled “Why the report rejects the other storage options”

The report rules out the alternatives in turn. It says LocalStorage is limited to roughly 5MB to 10MB and is synchronous text-only storage, which it calls completely useless for binary PDFs. It says IndexedDB is excellent for structured metadata and smaller binary objects, but less natural for treating large documents as persistent files with efficient byte-level access. It says the File System Access API is great when an app needs to work directly with files in the user’s filesystem, but that access requires user permission and is subject to browser security restrictions (the report).

MDN’s own account of why the origin private file system exists tracks that third objection closely. MDN describes the File System Access API as providing access to files using picker methods, and states that because those changes are being made to the user-visible file system there are a lot of security checks in place, giving safe browsing in Chrome as its example, to guard against malicious content being written to that file system. MDN says those writes are not in-place and instead use a temporary file, that the original is not modified unless it passes all the security checks, and that as a result these operations are fairly slow, with the performance suffering when making more significant, large-scale file updates such as SQLite database modifications (MDN, Origin private file system).

The report describes the origin private file system as providing a private, origin-scoped filesystem designed for persistent file-like data, with low-level byte access and optimized in-place writes, and states that it also offers synchronous access handles inside Web Workers for performance-sensitive workloads. Its code sample obtains the root with await navigator.storage.getDirectory(), takes a file handle with root.getFileHandle("working-draft.pdf", { create: true }), and writes a binary buffer through createWritable(), write(), and close() (the report).

OPFS gives beePDF a directory private to https://beepdf.app, so users do not face permission modals. The author describes direct byte-level file streams and near-native synchronous reads and writes in Web Workers through createSyncAccessHandle(). Files survive browser reloads and accidental tab closure, within the browser’s origin storage quota (the report).

MDN backs each of those properties with its own wording. On permissions, MDN says permission prompts and security checks are not required to access files in the OPFS, and that the OPFS is private to the origin of the page and not visible to the user like the regular file system. On speed, MDN says the OPFS offers low-level, byte-by-byte file access, that it does not require the same series of security checks and permission grants and is therefore faster than File System Access API calls, and that it has a set of synchronous calls available, where other File System API calls are asynchronous, that can be run inside web workers only so as not to block the main thread. On quotas, MDN says the OPFS is subject to browser storage quota restrictions, just like any other origin-partitioned storage mechanism, that the amount of space it uses can be read through navigator.storage.estimate(), and that clearing storage data for the site deletes the OPFS (MDN, Origin private file system).

MDN adds a constraint on the synchronous handle that the report’s wording leaves implicit. MDN says FileSystemSyncAccessHandle is only accessible inside dedicated Web Workers, so that its methods do not block execution on the main thread, and only for files within the origin private file system, and that as a result its methods are not subject to the same security checks as methods running on files within the user-visible file system and so are much more performant. MDN also notes that despite having “Sync” in its name, createSyncAccessHandle() is itself asynchronous, and that close() releases the exclusive lock previously put on the file associated with the handle (MDN, FileSystemSyncAccessHandle).

When a PDF is dropped into beePDF, the browser reads its File into an ArrayBuffer and immediately saves the document to the local OPFS workspace. IndexedDB holds metadata and a small thumbnail, making searching and tagging straightforward, according to the author.

Web Workers render page thumbnails, extract plain text or Markdown, and run word-level diffs to keep the UI at 60 FPS. Modifying or signing a document produces a fresh Uint8Array in memory, then a URL.createObjectURL Blob triggers a client download. The author also reports an airplane mode test: after loading beePDF and disconnecting completely, documents could still be merged, split, compressed, or signed (the report).

MDN’s description of the role the report assigns to IndexedDB matches the split it describes. MDN describes IndexedDB as a low-level API for client-side storage of significant amounts of structured data, including files and blobs, states that it uses indexes to enable high-performance searches of that data, and says that while Web Storage is useful for storing smaller amounts of data it is less useful for storing larger amounts of structured data. MDN says operations performed using IndexedDB are done asynchronously so as not to block applications, and that IndexedDB is available in web workers (MDN, IndexedDB API).

It says processing massive 500MB+ scanned PDFs inside browser JS can hit V8 heap memory limits on lower-end devices. It says heavy image compression or canvas manipulation must be offloaded to Web Workers, because otherwise rendering high-DPI canvases will freeze the UI thread. Its framing of both is that modern browsers provide a rich set of capabilities reachable through standardized Web APIs, and that building pure client-side file tools is nevertheless not without its limits (the report).

beePDF’s privacy requirement led to a storage choice grounded in the APIs’ behavior. File System Access API writes use a temporary file and pass security checks before modifying the user-visible filesystem, which MDN describes as slow for large updates. OPFS provides byte-by-byte access without those permission prompts or security checks, plus synchronous calls restricted to web workers (MDN, Origin private file system).

The split the report draws between the two client-side stores is the reusable part. Document bytes go to the OPFS, where MDN documents byte-level reads and writes and a synchronous handle usable in dedicated workers; metadata and thumbnails go to IndexedDB, which MDN documents as indexed storage of structured data with high-performance searches over it. An app that needs both large opaque blobs and queryable records about them has two different tools documented for the two different jobs, and the report assigns each the job its documentation describes (MDN, IndexedDB API).

MDN says the OPFS is subject to browser storage quota restrictions like any other origin-partitioned storage mechanism, and that clearing storage data for the site deletes the OPFS. MDN also says browsers persist the contents of the OPFS to disk somewhere, but that the created files cannot be expected to be found matched one-to-one, because the OPFS is not intended to be visible to the user (MDN, Origin private file system).

  • Storage: Origin-scoped stores have quotas and eviction rules that affect document storage.
  • Capabilities: OPFS and synchronous access handles, which MDN restricts to dedicated workers, have their own support requirements.
  • Performance: The author targets 60 FPS by moving thumbnail rendering, text extraction, and diffs off the main thread.
  • Which browsers and versions beePDF was tested on is not stated by the report, so the claims about speed and the airplane mode test cannot be pinned to an engine.
  • Whether the report’s synchronous access handles run in dedicated workers is not stated; MDN restricts FileSystemSyncAccessHandle to dedicated Web Workers.
  • Whether beePDF requests persistent storage, and so what happens to an OPFS working document under quota pressure, is not addressed by the report.
  • At what file size the V8 heap limits the report names are reached, and on which devices, is not stated beyond the report’s “500MB+ scanned PDFs” and “lower-end devices”.
  • Whether the roughly 5MB to 10MB LocalStorage figure the report gives for comparison holds on any particular browser is not confirmed.
  • Whether private browsing mode, in which MDN states some browsers throw on getDirectory(), was tested is not addressed.