DEV Community

daoming wen
daoming wen

Posted on Fully Autonomous

How to check whether a browser PDF tool actually processes files locally

A browser can reorganize a PDF without sending the file to a processing server. That makes an interesting implementation choice, but a “local processing” label still needs a reproducible check.

Disclosure: I represent PDF Local, a free browser tool for deleting, extracting, reordering and rotating PDF pages. This article was prepared with AI assistance. It describes a test readers can reproduce; it is not an independent certification or a claim that the whole web page makes no network requests.

Separate loading the app from processing the file

Downloading JavaScript, fonts or a PDF library is network activity. It does not by itself mean the document is uploaded. Conversely, seeing a local preview does not prove that the file stays local: a page can render a preview and upload the bytes afterward.

Check the entire operation: selecting the file, rendering previews, changing the page selection and downloading the result.

Use a disposable fixture

Create a three-page PDF with large labels ONE, TWO and THREE. Include a unique, harmless marker such as LOCAL-PDF-TEST-2026. Do not start with a confidential document.

  1. Open developer tools and select the Network panel before loading the tool.
  2. Enable Preserve log. Keep all request types visible, rather than filtering only Fetch/XHR.
  3. Let the application finish loading, then note or clear the initial request list.
  4. Select the fixture and perform one page operation, such as keeping pages 3 and 1 in that order.
  5. Inspect requests triggered during selection, editing and download. Check destinations, methods and request payloads, including form data and binary request bodies. WebSocket traffic can matter too.
  6. Open the downloaded PDF in another reader. Expect two pages: THREE, then ONE.

An unexpected request deserves investigation even if its URL does not contain “upload”. Absence of the marker in a payload is not proof that the document was not sent: the file could be binary, compressed or encoded.

A useful offline cross-check

After the app and its dependencies have loaded, use developer tools to simulate offline mode. Try the operation again with a fresh disposable fixture.

If selection, page manipulation and download still work, that supports the claim that the operation can run without a processing server. It does not prove what happened during the earlier online run. A lazy-loaded dependency may also fail offline even when the PDF processing itself is local. Interpret the two checks together.

For stricter assurance, examine the implementation, workers and third-party dependencies. The Network panel is an observation tool, not a complete security audit.

The small implementation boundary

This is the essential distinction in browser code:

// Reads bytes from a user-selected File into browser memory.
const inputBytes = await file.arrayBuffer();

// A local PDF library can consume those bytes.
const source = await PDFDocument.load(inputBytes);
const output = await PDFDocument.create();
const pages = await output.copyPages(source, [2, 0]); // human pages 3, 1
pages.forEach(page => output.addPage(page));
const result = await output.save();
Enter fullscreen mode Exit fullscreen mode

Here PDFDocument is imported from pdf-lib. The snippet deliberately omits the surrounding UI. Reading a File does not upload it; an upload requires some additional networking behavior. The rest of the page still needs inspection.

When exposing a page-selection API, validate one-based user input before converting to zero-based library indexes. Reject an empty selection and out-of-range or fractional page numbers. Decide explicitly whether duplicate pages are permitted. I checked the selection and ordering behavior with a generated fixture before preparing this post.

Local processing has limits

Memory still matters: a large PDF can exceed what a phone or browser tab can hold. Copying pages into a new document can affect document-level features, and modifying a digitally signed PDF can invalidate its signature. Keep the original and reopen the result to review it.

Removing pages is also different from redacting sensitive information from a retained page. A page organizer should not be presented as a secure redaction tool, OCR engine or text editor.

PDF Local includes a step-by-step local-processing verification guide. The same testing approach is useful for other browser file tools: give users an observable way to check what happens to a disposable file.

Top comments (0)