Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I built a free PDF editor that keeps your fonts and never uploads your file

You click a line in a PDF, type, and download. The new text uses the same font, the old words are really gone (not hidden under a white box), and the file never leaves your browser. Here is how the Aivdo PDF editor does it, and the bugs I hit on the way. Why most free PDF editors get this wrong A PDF is not a document with paragraphs. It is a list of drawing instructions: "use font F2 at 11 pt,…

Most free PDF editors struggle to maintain fonts and ensure files are not uploaded when editing. This is because a PDF is not a conventional document but rather a sequence of drawing commands that manipulate text and graphics. Most browser-based editors simply add white boxes for editing, resulting in font changes and hidden old text that can still be found through search or screen readers. To address these issues, the author developed a free PDF editor that keeps fonts intact and never uploads files.

The editor achieves this by converting text runs into editable lines, merging runs with the same font, size, and baseline into single lines. When a line is edited, the editor samples the background and text color from the rendered canvas to create a blending box that appears transparent. The editor also handles table cells by treating single wide space runs as separators, joining runs only with a word-sized gap to maintain proper alignment.

Determining the correct font for edited text is crucial, as most PDFs embed subsets of fonts rather than complete fonts. The editor identifies the font used in the PDF, strips any subset prefixes, and selects the best matching real font from a list of options. If the desired font is not available, the editor provides the user with a look-alike option and a button to choose an exact font.

To remove the original text accurately, the editor decompresses the page's content stream and iterates through each operator responsible for text rendering. It replaces the text operators with empty ones that move the text position by the same amount as the original string, ensuring the edited line takes up the same space as before. This method preserves the overall layout and prevents columns from running into each other.

After editing, the editor verifies its work by reopening the modified PDF with pdf.js, checking the page count, ensuring untouched text remains intact, and rendering each changed page. If any errors occur during this process, the editor defaults to leaving the original text unchanged and covering it with a box in the sampled background color, providing a useful backup option for users.

The editor supports various file types, including office invoices, letterheads, and fillable forms, maintaining correct font usage and preserving user data in all cases.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Detecting Exploitation Attempts Against NetScaler CVE-2026-88779

Detecting Exploitation Attempts Against NetScaler CVE-2026-88779 What to look for CVE-2026-88779 is an out-of-bounds write (CWE-119) in NetScaler SAML authentication that produces denial of service.

  • CVE-2026-88779 vulnerability impacts NetScaler Gateways and AAA virtual servers
  • Out-of-bounds write flaw leads to denial of service
  • Detection involves monitoring appliance restarts, SAML traffic, and logs

Stamp a Capacity Contract Before the Agent Leaves the Notebook

You should refuse the route until a capacity contract is stamped. A free model path that answered your demo is not capacity.

  • Agent must sign capacity contract before leaving notebook
  • Free model path insufficient for capacity requirement
  • Verify four details: allowance text, server identity, data class, access date

Case Study: Freeze Leaderboard Tie-Breaks Before an Agent Writes the Ranker

You should freeze leaderboard tie-break rules as executable checks before any coding agent writes the ranking function. A polished draft can still reorder equal scores in ways your support replies…

  • Freeze leaderboard tie-break rules crucial before ranking function
  • Ranker must be deterministic, reject incomplete rows
  • Contract includes decision table mapping inputs to results

More from Thursday 8 October →