Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How to Flatten a PDF and Remove Hidden Metadata Without Uploading Confidential Files

Every week, people fill out a W-9, sign a vendor onboarding packet, or annotate a contract, hit Save, and email the PDF assuming the document is locked. Two hours later, a client opens it in Apple Preview and sees blank form boxes, or worse, someone clicks into a field and alters a dollar figure or extracts the author's laptop username and edit history straight from the file bytes. Knowing how to…

When filling out PDF documents like W-9s, vendor onboarding packets, or contracts, users often assume the document is secure after clicking Save and emailing it. However, hidden metadata and editable forms can reveal confidential information. To properly flatten a PDF and remove sensitive data without uploading files, one must understand the internal structures of a PDF file.

After saving, three layers typically remain active: Interactive/AcroForm and Widget annotations for text inputs and checkboxes, the /Info dictionary and catalog XMP Metadata stream for author, creator, and other information, and incremental %%EOF save history that preserves earlier revisions. Flattening techniques can be divided into vector AcroForm flattening, which burns form appearances into static page drawing commands and removes annotations, and full-page 200 DPI image flattening, which rasterizes each page at high resolution with zero editable layers.

The classic method of printing to PDF introduces flaws like page rescaling and metadata addition. To flatten a PDF and scrub metadata without external servers, modern browsers can run the process locally using pdf-lib and pdf.js libraries. First, inspect the file to count revisions, interactive fields, and metadata. Then, clear both the /Info dictionary and catalog XMP Metadata stream by setting titles, authors, subjects, keywords, producers, creators to empty strings and deleting the corresponding references. This ensures the PDF is secure and ready for sharing.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Writing a Great Post Title

This is a submission for the MLH x DEV Writing Challenge What I Built Demo Partner Technologies Hackathon Experience

I Tried to Vibe-Code My Way Out of Job Hunting. It Broke in a Week

Full disclosure: I'm a product manager at Spicrawl. This is the feature I wish had existed during my own job search, before I joined. The tab ritual For 4 months my mornings started the same way.

  • Product manager tried to automate job hunting using AI tools
  • Script scraped job boards for a week before encountering issues
  • Author abandoned scraper, returned to manual tab-based search

A DLNA control point in Kotlin: discovery and eight SOAP actions

When you press Cast in Yonto Player on an Android phone, one of the sections in the picker is DLNA: TVs, Kodi boxes and AV receivers that take a video address and play it.

  • Kotlin implementation of DLNA control point in Yonto Player for Android
  • SSDP M-SEARCH requests sent twice for potential UDP packet loss

My Kiro Crew goes where I go

My laptop turned out to be a pretty poor home for an AI team. It nods off the moment I close the lid, and on a busy day it was short of memory.

  • Team's AI operations moved to AWS server for constant access
  • Launcher handles technical aspects, creates private server
  • Server isolated from internet, accessed via secure tunnel

More from Sunday, 29 November 2026 →