|
11 | 11 | // Create new PHPPresentation object
|
12 | 12 | echo date('H:i:s') . ' Create new PHPPresentation object' . EOL;
|
13 | 13 | $objPHPPresentation = new PhpPresentation();
|
| 14 | +$oLayout = $objPHPPresentation->getLayout(); |
14 | 15 |
|
15 | 16 | // Set properties
|
16 | 17 | echo date('H:i:s') . ' Set properties' . EOL;
|
17 |
| -$objPHPPresentation->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 01 Title')->setSubject('Sample 01 Subject')->setDescription('Sample 01 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); |
| 18 | +$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 01 Title')->setSubject('Sample 01 Subject')->setDescription('Sample 01 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); |
18 | 19 |
|
19 | 20 | // Create slide
|
20 | 21 | echo date('H:i:s') . ' Create slide' . EOL;
|
21 | 22 | $currentSlide = $objPHPPresentation->getActiveSlide();
|
22 | 23 |
|
23 | 24 | // Create a shape (drawing)
|
24 |
| -echo date('H:i:s') . ' Create a shape (drawing)'.EOL; |
| 25 | +echo date('H:i:s') . ' Create a shape (drawing)' . EOL; |
25 | 26 | $shape = $currentSlide->createDrawingShape();
|
26 | 27 | $shape->setName('PHPPresentation logo')
|
27 |
| -->setDescription('PHPPresentation logo') |
28 |
| -->setPath('./resources/phppowerpoint_logo.gif') |
29 |
| -->setHeight(36) |
30 |
| -->setOffsetX(10) |
31 |
| -->setOffsetY(10); |
| 28 | + ->setDescription('PHPPresentation logo') |
| 29 | + ->setPath('./resources/phppowerpoint_logo.gif') |
| 30 | + ->setHeight(36) |
| 31 | + ->setOffsetX(10) |
| 32 | + ->setOffsetY(10); |
32 | 33 | $shape->getShadow()->setVisible(true)
|
33 |
| -->setDirection(45) |
34 |
| -->setDistance(10); |
| 34 | + ->setDirection(45) |
| 35 | + ->setDistance(10); |
35 | 36 | $shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/')->setTooltip('PHPPresentation');
|
36 | 37 |
|
37 | 38 | // Create a shape (text)
|
38 |
| -echo date('H:i:s') . ' Create a shape (rich text)'.EOL; |
| 39 | +echo date('H:i:s') . ' Create a shape (rich text)' . EOL; |
39 | 40 | $shape = $currentSlide->createRichTextShape()
|
40 | 41 | ->setHeight(300)
|
41 | 42 | ->setWidth(600)
|
42 | 43 | ->setOffsetX(170)
|
43 | 44 | ->setOffsetY(180);
|
44 |
| -$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); |
| 45 | +$shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); |
45 | 46 | $textRun = $shape->createTextRun('Thank you for using PHPPresentation!');
|
46 | 47 | $textRun->getFont()->setBold(true)
|
47 |
| -->setSize(60) |
48 |
| -->setColor( new Color( 'FFE06B20' ) ); |
| 48 | + ->setSize(60) |
| 49 | + ->setColor(new Color('FFE06B20')); |
49 | 50 |
|
50 | 51 | // Set Note
|
51 | 52 | echo date('H:i:s') . ' Set Note' . EOL;
|
52 | 53 | $oNote = $currentSlide->getNote();
|
53 |
| -$oRichText = $oNote->createRichTextShape()->setHeight(300)->setWidth(600)->setOffsetX(170)->setOffsetY(180);; |
| 54 | +$oRichText = $oNote->createRichTextShape() |
| 55 | + ->setHeight($oLayout->getCY($oLayout::UNIT_PIXEL)) |
| 56 | + ->setWidth($oLayout->getCX($oLayout::UNIT_PIXEL)) |
| 57 | + ->setOffsetX(170) |
| 58 | + ->setOffsetY(180); |
54 | 59 | $oRichText->createTextRun('A class library');
|
55 | 60 | $oRichText->createParagraph()->createTextRun('Written in PHP');
|
56 | 61 | $oRichText->createParagraph()->createTextRun('Representing a presentation');
|
|
59 | 64 | // Save file
|
60 | 65 | echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
|
61 | 66 | if (!CLI) {
|
62 |
| - include_once 'Sample_Footer.php'; |
| 67 | + include_once 'Sample_Footer.php'; |
63 | 68 | }
|
0 commit comments