Text at all costs: PPT. Second take
I recently announced my option to read PowerPoint presentations using pure PHP. Then I regretted that the class was crude and needed to be improved. How long, short, but errors were found - now the files are read much better, without any dirt. I hope you find my experience useful.
Error (main), as expected was in the wrong reading
Previously, I read absolutely incorrectly, it is surprising that this somehow worked. Due to the fact that the error is serious and, perhaps, there are people who may need my classes, I am writing a topic for the second time.
You can get the code with comments on GitHub .
Error (main), as expected was in the wrong reading
PersistDirectory
. Either my English is failing me, or Microsoft is writing my documents too confusing, but OffsetPersistDirectory
I did not immediately figure out how to read the structure by offset . It turns out that the structure consists of triples: PersistId
- The ID of the first entry into the directory, cPersist
- The number of entries to read after this value. And then n = cPersist
four byte valuespersistOffset
- offsets to occurrences in PersistDirectory
. Previously, I read absolutely incorrectly, it is surprising that this somehow worked. Due to the fact that the error is serious and, perhaps, there are people who may need my classes, I am writing a topic for the second time.
You can get the code with comments on GitHub .