Comment

Comment by NohatCoder

PDF seems to fit a world-view where the highest objective of a document is to be printed on paper.

From a machine-parsing perspective PDF files are a nightmare. Chunks of text may be broken anywhere, mid-sentence, mid-word. These chunks may appear in the document in any order.

Spaces may be encoded as spaces, or they may be created a number of other ways, like by positioning chunks, or setting character spacing per character.

The mapping from code point to glyph does not need to be pure Unicode, a PDF document may contain a custom font with additional glyphs.

This is all stuff I learned by trying to parse a limited set of PDFs found in the wild.

All of these gotchas are by the way completely PDF/A compliant.

parent NohatCoder 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton