August 7, 2026
PDFs strike again
Why are all the amounts values negative?
The mystery minus signs were hiding in plain sight — and the comments had opinions
TLDR: The bug came from hidden minus signs baked into the PDF, making normal amounts look negative when software extracted the text. Commenters split between careful fixes and the nuclear option of image-reading software, with plenty of jokes about PDFs being cursed.
A customer complained that every money amount in a converted bank statement looked negative, and that kicked off a deliciously nerdy mini-mystery. The culprit? The PDF had been built with secret invisible minus signs after some numbers. On the page, positive values looked normal, but under the hood there was still a hidden “-” sitting there, quietly sabotaging the export. It’s the kind of tiny formatting choice that turns into full-blown chaos once software tries to read it.
And the community absolutely pounced. One camp basically said, “This is why PDFs are chaos goblins,” with readers warning that what you see on screen is not always what the file actually contains. Another group pushed back on the proposed fix of ignoring non-black text, saying that rule sounds neat until it blows up on a different document. Their alternative? Check what’s actually visible on the rendered page instead of trusting the hidden text layer.
Then came the hot take brigade: just use OCR—optical character recognition, meaning let software read the page like an image. One commenter went full scorched earth, arguing PDF parsing is such a mess that OCR might actually be the saner option now. Others offered a more street-smart workaround: if the minus sign comes after the number instead of before it, maybe just skip it. And yes, there was even one hilariously disappointed reader who arrived expecting a deep accounting debate about debits and credits and instead got ambushed by invisible punctuation drama. The internet may not agree on the fix, but it definitely agrees on one thing: PDFs remain deeply unserious.
Key Points
- •A customer discovered that all amounts extracted from a converted PDF were showing as negative.
- •Angus Cheng found that the PDF encoded trailing minus signs even for values that appeared positive on the page.
- •In one case, the minus sign was drawn in a gray color matching the background, making it invisible while remaining present in the text layer.
- •The article explains several PDF text and graphics commands, including BT, ET, Tf, Td, Tj, g, and G, to show how the values were rendered.
- •Cheng proposes two fixes: use OCR on rendered page images or modify extraction logic to ignore non-black text for this statement type.