Cookbook

In-memory PPTX presentations

phppptx Premium licenses include support for in-memory presentations. Thanks to this functionality it is possible to work without files in the fs. Instead, you can use in memory objects or from other sources like databases, in-memory data structures, redis… This also enables better performance and flexibility of use.

PptxStructure is the class that serves as an in-memory PPTX in phppptx. An object of that class can be generated on the fly with CreatePptx and the static attribute $returnPptxStructure:

Or from an existing file, using the PptxStructure class:

PptxStructure can be easily serialized for later reuse. For example, as a template to generate new presentations:

The classes and methods that support in-memory PPTX are the following:

PptxStructure objects should not be confused with the phppptx stream mode. The latter generates and returns automatically the PPTX file, but it doesn't allow storing it unless its output is captured. That's why it is useful for specific purporses as generating and downloading PPTX without being neccesary its later reuse.

Related information