|
|
|
|
|
by layer8
167 days ago
|
|
You can’t insert data into the middle of a file (or remove portions from the middle of a file) without either rewriting it completely, or at least rewriting everything after the insertion point; the latter requires holding everything after the insertion point in memory (or writing it out to another file first, then reading it in and writing it out again). PDF is designed to not require holding the complete file in memory. (PDF viewers can display PDFs larger than available memory, as long as the currently displayed page and associated metadata fits in memory. Similar for editing.) |
|
ABCDE, to insert 1 after C: store D, overwrite D with 1, store E, overwrite E with D, write E.