Practical phppptx

Settings

Introduction

phppptx provides the necessary methods to modify the layout and settings of the presentation and slides, as well as set the internal properties such as author, description and keywords.

Presentation properties

A presentation has internal properties such as subject, creator, description or categories. Besides, it counts with full-customizable properties in its name and value.

phppptx includes addProperties to define the properties:

x
 
1
public function addProperties($values)
2

$values is an array of the properties to be added. Besides its predefined properties like subject or creator, the custom key allows to add new properties.

E.g., for inserting multiple properties in the presentation, use the code:

19
 
1
$properties = array(
2
    'title' => 'My title',
3
    'subject' => 'My subject',
4
    'creator' => 'The creator',
5
    'keywords' => 'keyword 1, keyword 2, keyword 3',
6
    'description' => 'The description could be much longer than this',
7
    'category' => 'My category',
8
    'contentStatus' => 'Draft',
9
    'Manager' => 'The boss',
10
    'Company' => 'My company',
11
    'custom' => array(
12
        'My custom text' => array('text' => 'This is a reasonably large text'),
13
        'My custom number' => array('number' => '4567'),
14
        'My custom date' => array('date' => '1962-01-27T23:00:00Z'),
15
        'My custom boolean' => array('boolean' => true)
16
    )
17
);
18
$pptx->addProperties($properties);
19
Presentation settings

The method for applying the presentation settings is setPresentationSettings.

It allows setting options such as the presentation type or notes properties.

The following sample code sets A3 as the presentation format:

3
 
1
$pptx = new CreatePptx();
2
$pptx->setPresentationSettings(array('type' => 'A3'));
3
Slide settings

The method for applying slide settings is setSlideSettings. For example, to apply a new layout to the active slide:

2
 
1
$pptx->setSlideSettings(array('layout' => 'Title Slide'));
2
Tips and tricks

The setRtl method sets global right to left options.

Next - Get information
­
­