forked from PHPOffice/PHPPresentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sample_18_Animation.php
60 lines (45 loc) · 1.58 KB
/
Sample_18_Animation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include_once 'Sample_Header.php';
use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\Slide\Animation;
// Create new PHPPresentation object
echo date('H:i:s') . ' Create new PHPPresentation object' . EOL;
$objPHPPresentation = new PhpPresentation();
$oDrawing1 = clone $oShapeDrawing;
$oRichText1 = clone $oShapeRichText;
// Create slide
echo date('H:i:s') . ' Create slide' . EOL;
$oSlide1 = $objPHPPresentation->getActiveSlide();
$oSlide1->addShape($oDrawing1);
$oSlide1->addShape($oRichText1);
$oAnimation1 = new Animation();
$oAnimation1->addShape($oDrawing1);
$oSlide1->addAnimation($oAnimation1);
$oAnimation2 = new Animation();
$oAnimation2->addShape($oRichText1);
$oSlide1->addAnimation($oAnimation2);
$oDrawing2 = clone $oShapeDrawing;
$oRichText2 = clone $oShapeRichText;
$oSlide2 = $objPHPPresentation->createSlide();
$oSlide2->addShape($oDrawing2);
$oSlide2->addShape($oRichText2);
$oAnimation4 = new Animation();
$oAnimation4->addShape($oRichText2);
$oSlide2->addAnimation($oAnimation4);
$oAnimation3 = new Animation();
$oAnimation3->addShape($oDrawing2);
$oSlide2->addAnimation($oAnimation3);
$oDrawing3 = clone $oShapeDrawing;
$oRichText3 = clone $oShapeRichText;
$oSlide3 = $objPHPPresentation->createSlide();
$oSlide3->addShape($oDrawing3);
$oSlide3->addShape($oRichText3);
$oAnimation5 = new Animation();
$oAnimation5->addShape($oRichText3);
$oAnimation5->addShape($oDrawing3);
$oSlide3->addAnimation($oAnimation5);
// Save file
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
if (!CLI) {
include_once 'Sample_Footer.php';
}