📜 ⬆️ ⬇️

Text at any cost: PPT. Take the second

I recently announced my version of reading PowerPoint presentations using pure PHP. Then I noted with regret that the class is crude and needs to be improved. How long, how short, but errors were found - now the files are read much better, without any dirt. I hope you will benefit from my work.

The error (the main one), as it was supposed to have been in the wrong reading of PersistDirectory . Either my English fails me, or Microsoft writes its documents too intricately, but I didn’t realize how to read the structure by OffsetPersistDirectory offset right away. It turns out the structure consists of triples: PersistId - ID of the first entry in the directory, cPersist - the number of entries that need to be read after this value. And then n = cPersist four-byte n = cPersist values ​​— offsets to the entries in PersistDirectory .

I used to read absolutely wrong, surprisingly, it somehow worked. Due to the fact that the error is serious and, possibly, there are people who can use my classes, I am writing a topic a second time.
')
You can get the code with comments on GitHub .

Text at any cost


Source: https://habr.com/ru/post/76731/


All Articles