PHPPresentation

PHPPresentation

 
 

PHP Class Library for Presentation Formats

Read, Write, Process & Convert Microsoft PowerPoint & OpenOffice Presentation file formats.

 

PHPPresentation is a collection of classes provided as an open-source PHP library that lets you perform read and write operations on different Microsoft PowerPoint and OpenOffice presentation file formats. Using PHPPresentation library, you can work with presentation slides, shapes, formatting styles, plain and 3D charts, slide comments and drawing objects.

Getting Started with PHPPresentation

To use PHPPresentation on your system, you need to install PHP version 5.1 or newer.  The recommended way to install the PHPPresentation library is through composer. Please add the following lines to your composer.json.

Here is the command

 {
    "require": {
       "phpoffice/phppresentation": "dev-master"
    }
}

Composer offers a convenient installer that you can execute directly from the command line. Feel free to download this file or review it on GitHub. There are two ways to install Composer. Install it locally as part of your project, or globally as a system wide executable.

You can also manually install PHPPresentation by downloading the latest release from the github releases page . Please do register the autoloader if you do not use composer in your project.

Here is the command

 require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php';
\PhpOffice\PhpPresentation\Autoloader::register();

Please also download the latest PHPOffice/Common release from its releases page. You must register its autoloader, too.

Here is the command

 require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php';
\PhpOffice\Common\Autoloader::register();

Customize Presentation Settings

PHPPresentation allows you to access and set various properties of presentations. Title, creator and company name can be configured. You can also configure if the presentation displays the comments or not. Similarly, you can also set the last view of the presentation, thumbnail of the presentation, as well as the zoom value for the presentation.

Customize Slide Settings

PHPPresentation allows you to define the name of the slides. You can also make any slides visible or hidden within the presentation. You can add various type of shape objects to slides, such as rich-text, line, chart, drawing, and table. Furthermore, you can also configure the common properties and styles of these shapes. Multiple animations can be created in a slide. WMV and OGV video media can be embedded in slides for Microsoft Windows and Linux readers, respectively. RichText, drawing objects and tables can also be worked with using PHPPresentation.

Work with Charts and Styles

Using PHPPresentation you can create, customize and embed charts in slides. Both minor and major type of gridlines can be defined for the X and Y-axis. Also, you can configure the gridline width, its fill type and fill color. At the moment support is available for Bar Charts and 3D Bar Charts.