This is all impressive, but the PDF format is what makes all the magic possible. Among its features that make such a thing easily achievable:
- The relevant table-of-content of its data is located at the end, unlike most other file format. (You can put it near the begnning too, known as "optimized PDF" to make displaying the first page faster when downloading sequentially.)
- The PDF format is, surprisingly, text with embeeded byte streams which can contain any data.
- It does require a !PDF marker near the beginning, but it doesn't need to be first.
- It support natively ZIP compression, so embedding a ZIP inside is easy.
- ZIP allows "cheating" by not really compressing data, thus allowing data verbatim and allowing large chunks of arbitrary data, as long as you can control the first few bytes.
With these technical freedom, building a PDF that look like multiple file format is more accessible.
- The relevant table-of-content of its data is located at the end, unlike most other file format. (You can put it near the begnning too, known as "optimized PDF" to make displaying the first page faster when downloading sequentially.)
- The PDF format is, surprisingly, text with embeeded byte streams which can contain any data.
- It does require a !PDF marker near the beginning, but it doesn't need to be first.
- It support natively ZIP compression, so embedding a ZIP inside is easy.
- ZIP allows "cheating" by not really compressing data, thus allowing data verbatim and allowing large chunks of arbitrary data, as long as you can control the first few bytes.
With these technical freedom, building a PDF that look like multiple file format is more accessible.