A PDF can look completely ordinary and still contain information that most people never notice.
Open the document, read the text, inspect the images and everything appears fine.
But the document may also contain metadata.
Depending on how it was created, that information can include an author field, document title, subject, keywords, creation date, modification date and software information.
These details aren't necessarily sensitive, but they can be worth checking before sharing a document.
What actually counts as PDF metadata?
PDF files have a document information dictionary that can contain properties such as:
Title
Author
Subject
Keywords
Creator
Producer
CreationDate
ModDate
Some PDFs also use XMP metadata, which is a more structured metadata format.
XMP can contain additional information and may coexist with the traditional document information dictionary.
This is important because changing one set of properties doesn't automatically mean every metadata field has been removed.
A document can also contain information outside ordinary metadata fields, including annotations, attachments, form data and embedded objects.
These are separate things and need separate handling.
Reading metadata with JavaScript
For a browser-based application, a PDF library can expose document properties without requiring a server-side processing step.
For example, PDF.js can be used to inspect metadata:
const loadingTask = pdfjsLib.getDocument({
data: new Uint8Array(arrayBuffer)
});
const pdf = await loadingTask.promise;
const metadata = await pdf.getMetadata();
console.log(metadata.info);
console.log(metadata.metadata?.getAll());
This is a simplified inspection example. The application still needs to handle loading failures and documents that contain incomplete or unusual metadata.
The interesting part is that metadata inspection can happen locally in the browser.
No separate upload is inherently required for this operation.
Removing metadata requires more care
Reading metadata and removing it are different tasks.
An application might clear standard document properties while leaving other information untouched.
For example, annotations can contain author information. Embedded files can contain their own metadata. Existing content may also contain names, email addresses or other identifying details.
Simply changing the Author field isn't the same as sanitizing an entire document.
A proper sanitization workflow should clearly explain what it examines and what it removes.
It should also avoid promising that every possible identifying detail has disappeared unless the application actually verifies that.
This distinction matters when building tools for people who share contracts, reports, scanned documents or exported business files.
Build understandable privacy controls
I think metadata tools should show users what they are about to change.
A useful interface could display the existing metadata, allow users to select fields for removal and provide a processed copy.
It should also explain the difference between metadata removal and broader document sanitization.
That is much more useful than a single button labeled Clean PDF with no further explanation.
I've been working on browser-based file utilities through Pocket PDF, including PDF-related workflows and other everyday file operations.
The project processes files directly in the browser, without an account, installation or upload to a processing server.
You can find it at https://www.pocketpdf.site.
One question for developers working with document security: do you prefer metadata inspection and removal as separate operations, or would you combine them into one workflow with a preview?
