logoalt Hacker News

throwanem05/03/20254 repliesview on HN

I tossed a legal document at it which was recently of passing interest to me, and it looks like embedded fonts still need some work. I'm not inclined to share a test case from what I have, which relates to a change of name and in any case was not really prepared by anyone especially competent when it comes to PDFs and their content; I tested with the first, facially void, version I was given. But it is possible I'll find more use for this tool, and if a shareable test case does come along then I'll do so. (And heaven knows with this document format, embedded fonts are a total nightmare always, even somehow in programmatic authoring. I'm not criticizing!)

On a similar note, a downloadable (single-file HTML or so, although these days some kind of HTTP service is a practical necessity) version would be nice to have. Low pri even from my perspective; it isn't that I spend a lot of time in places with no cell signal, so much as just that tethering on an a la carte plan gets out of hand pretty quick, since applications aren't at all required to honor or even notice the existence of the "data saver" option.

This is really neat! Thanks for posting it, I've bookmarked it for later use in the "just need a quick tweak" kind of case. I'll look forward to seeing how it develops!


Replies

wffurr05/03/2025

Fonts on the web are super hard. There’s hardly any useful browser APIs for the kind of typesetting you need for PDFs: itemization, character bounding boxes, font file sub setting, etc. To solve or properly, you need to include a lot of code, e.g. all of harfbuzz compiled to wasm.

show 1 reply
gus_massa05/04/2025

Emedded fonts only embed the used characters, so if ypu want to change "John" to "Mary" and there is no capital "M" elsewhere in the doccument, you are out of luck. Can this be your problem?

show 1 reply
philjohnson05/04/2025

Thank you!

I'll take a look at improving rendering embedded font support. And that's a neat idea to be able to download it for offline, I'll give some thought to that. Appreciate your feedback!

show 2 replies
hakfoo05/05/2025

I love the idea of a downloadable version because I suspect there are a lot of business cases of

* Need to make a relatively narrow change to a PDF (add a line, reorder pages, concatenate two files)

* Adobe is $$$ and pretty much a subscription-only fiasco. Even the most trivial tasks are paywalled.

* Even if you're paying for Adobe at a corporate level, getting the IT clearance to get it installed might be more time sink than the actual task,

We have a server that had pdftk installed to generate some pre-filled documents and I ended up using that to concatenate two PDF files instead of fighting to get Real Acrobat.