| I'm also somewhat familiar with PDF format (wrote a tiny one "by hand" for fun few years ago, read the spec). It is an interesting format, and like OP said, designed for computers from another generation. It has many cleaver features that made it possible to edit (and read) in computers with less memory than the file. For example. Do you want to change something in the middle of the file? Change a byte to discard, copy only relevant text to end of the file and never touch that area again. No need to memmove half ths file. As side effect, the file is read from the end (thats why some PDFs only load when the download finishs, there are workarounds though). The spec advises the reader to place the index tables (I don't remember their actual name, they are pointers using offsets) in a tree-like structure. It had to be "allocate" while writing the file (again, to avoid memove). The format is also very oriented toward printing. Gives a lot of control. Unlike OP, I found the format a bit bloated. It specifies many interactive, acessibility, safety features that I don't think anyone but Adobe provides full supports. Anyway. Now I'm looking into fonts. That are much more sane. Just a plain and old likely turing complete database. Seems great to place to hide information. Also (for those into it, not me) seems a great vector for attack. Pretty much everyone uses the same shaper library (harfbuzz). It is support by virtually every device. |