Skip to content

Commit db98633

Browse files
committed
Merge branch 'develop' into issue179
2 parents 99f1a7d + def4684 commit db98633

File tree

143 files changed

+7616
-5275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+7616
-5275
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
- Fixed the image project - @mvargasmoran GH-177
77
- PowerPoint2007 Writer : Bugfix for printing slide notes - @JewrassicPark GH-179
88

9+
### Changes
10+
- PhpOffice\PhpPresentation\Writer\ODPresentation : Move to Design Pattern Decorator - @Progi1984
11+
- PhpOffice\PhpPresentation\Writer\PowerPoint2007 : Move to Design Pattern Decorator - @Progi1984
12+
- PhpOffice\PhpPresentation\Shape\Type\AbstracType\getData has been deprecated for PhpOffice\PhpPresentation\Shape\Type\AbstracType\getSeries - @Progi1984 GH-169
13+
- PhpOffice\PhpPresentation\Shape\Type\AbstracType\setData has been deprecated for PhpOffice\PhpPresentation\Shape\Type\AbstracType\setSeries - @Progi1984 GH-169
14+
- Added documentation for chart series (font, outline, marker) - @Progi1984 GH-169
15+
16+
### Features
17+
- ODPresentation & PowerPoint2007 Writer : Add support for Comment - @Progi1984 GH-116
18+
- ODPresentation & PowerPoint2007 Writer : Thumbnail of the presentation - @Progi1984 GH-125
19+
- ODPresentation & PowerPoint2007 Writer : Add support for Gridlines in Chart - @Progi1984 GH-129
20+
- ODPresentation & PowerPoint2007 Writer : Support for images in base 64 - @Progi1984 GH-168
21+
- ODPresentation & PowerPoint2007 Writer : Marker of Series in Line & Scatter chart is customizable - @Progi1984 GH-169
22+
- ODPresentation & PowerPoint2007 Writer : Outline of Series in Line & Scatter chart is customizable - @Progi1984 GH-169
23+
- ODPresentation & PowerPoint2007 & Serialized Writer : Support for Zip Adapter - @Progi1984 GH-176
24+
- ODPresentation & PowerPoint2007 Writer : language property to TextElement - @skrajewski & @Progi1984 GH-180
25+
- ODPresentation & PowerPoint2007 Writer : Add Font Support For Chart Axis - @jrking4 GH-186
26+
927
## 0.6.0 - 2016-01-24
1028

1129
### Bugfix

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.6.0

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"php": ">=5.3.0",
2323
"ext-xml": "*",
2424
"ext-zip": "*",
25-
"phpoffice/common": "0.2.*"
25+
"phpoffice/common": "0.2.*"
2626
},
2727
"require-dev": {
2828
"phpunit/phpunit": "3.7.*",

docs/general.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Document information
5353
--------------------
5454

5555
You can set the document information such as title, creator, and company
56-
name. Use the following functions:
56+
name. Use the following functions :
5757

5858
.. code-block:: php
5959
@@ -69,3 +69,37 @@ name. Use the following functions:
6969
$properties->setSubject('My subject');
7070
$properties->setKeywords('my, key, word');
7171
72+
73+
Presentation Properties
74+
-----------------------
75+
76+
You can define some properties which are relative to the presentation, like the zoom or the thumbnail.
77+
78+
79+
Thumbnail
80+
`````````
81+
82+
You can define the thumbnail of the presentation with the method ``setThumbnailPath``.
83+
84+
.. code-block:: php
85+
86+
$oPresentation = new PhpPresentation();
87+
$oProperties = $oPresentation->getPresentationProperties();
88+
// Set path of the thumbnail
89+
$oProperties->setThumbnailPath(__DIR__.'\resources\phppowerpoint_logo.gif');
90+
// Get path of the thumbnail
91+
echo $oProperties->getThumbnailPath();
92+
93+
Zoom
94+
````
95+
96+
You can define the zoom of the presentation with the method ``setZoom``.
97+
98+
.. code-block:: php
99+
100+
$oPresentation = new PhpPresentation();
101+
$oProperties = $oPresentation->getPresentationProperties();
102+
// Set zoom of the presentation (3 = 300%)
103+
$oProperties->setZoom(3);
104+
// Get zoom of the presentation
105+
echo $oProperties->getZoom();

docs/index.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
contain the root `toctree` directive.
55
66
Welcome to PHPPresentation's documentation
7-
========================================
7+
==========================================
88

99
|PHPPresentation|
1010

@@ -19,7 +19,8 @@ PHPPresentation is a library written in pure PHP that provides a set of classes
1919
slides
2020
shapes
2121
styles
22-
writersreaders
22+
writers
23+
readers
2324
recipes
2425
faq
2526
credits
@@ -32,6 +33,8 @@ PHPPresentation is a library written in pure PHP that provides a set of classes
3233
:caption: Shapes
3334

3435
shapes_chart
36+
shapes_comment
37+
shapes_richtext
3538
shapes_table
3639

3740
Indices and tables

docs/readers.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.. _writersreaders:
2+
3+
Readers
4+
=======
5+
6+
ODPresentation
7+
--------------
8+
9+
The name of the reader is ``ODPresentation``.
10+
11+
.. code-block:: php
12+
13+
$oWriter = IOFactory::createReader('ODPresentation');
14+
$oWriter->load(__DIR__ . '/sample.odp');
15+
16+
PowerPoint97
17+
------------
18+
19+
The name of the reader is ``PowerPoint97``.
20+
21+
.. code-block:: php
22+
23+
$oWriter = IOFactory::createReader('PowerPoint97');
24+
$oWriter->load(__DIR__ . '/sample.ppt');
25+
26+
PowerPoint2007
27+
--------------
28+
29+
The name of the reader is ``PowerPoint2007``.
30+
31+
.. code-block:: php
32+
33+
$oWriter = IOFactory::createReader('PowerPoint2007');
34+
$oWriter->load(__DIR__ . '/sample.pptx');
35+
36+
Serialized
37+
----------
38+
39+
The name of the reader is ``Serialized``.
40+
41+
.. code-block:: php
42+
43+
$oWriter = IOFactory::createReader('Serialized');
44+
$oWriter->load(__DIR__ . '/sample.phppt');

docs/shapes.rst

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,22 @@ Example:
3030
Rich text
3131
---------
3232

33-
Rich text shapes contain paragraphs of texts. To create a rich text shape, use ``createRichTextShape`` method of slide.
34-
35-
Below are the properties that you can set for a rich text shape.
36-
37-
- ``wrap``
38-
- ``autoFit``
39-
- ``fontScale`` : font scale (in percentage) when autoFit = RichText::AUTOFIT_NORMAL
40-
- ``lnSpcReduction`` : line spacing reduction (in percentage) when autoFit = RichText::AUTOFIT_NORMAL
41-
- ``horizontalOverflow``
42-
- ``verticalOverflow``
43-
- ``upright``
44-
- ``vertical``
45-
- ``columns``
46-
- ``bottomInset`` in pixels
47-
- ``leftInset`` in pixels
48-
- ``rightInset`` in pixels
49-
- ``topInset`` in pixels
50-
- ``autoShrinkHorizontal`` (boolean)
51-
- ``autoShrinkVertical`` (boolean)
52-
53-
Properties that can be set for each paragraphs are as follow.
54-
55-
- ``alignment`` see *[Alignment](#alignment)*
56-
- ``font`` see *[Font](#font)*
57-
- ``bulletStyle`` see *[Bullet](#bullet)*
33+
The Rich text has :ref:`its own page <shapes_richtext>`.
5834

5935
Line
60-
-------
36+
----
6137

6238
To create a line, use `createLineShape` method of slide.
6339

6440
Chart
41+
-----
42+
43+
The Chart has :ref:`its own page <shapes_chart>`.
44+
45+
Comment
6546
-------
6647

67-
The Chart has now :ref:`its own page <shapes_chart>`.
48+
The Comment has :ref:`its own page <shapes_comment>`.
6849

6950
Drawing
7051
-------
@@ -79,6 +60,6 @@ To create a drawing, use `createDrawingShape` method of slide.
7960
->setPath('/path/to/drawing.filename');
8061
8162
Table
82-
-------
63+
-----
8364

84-
The Table has now :ref:`its own page <shapes_table>`.
65+
The Table has :ref:`its own page <shapes_table>`.

docs/shapes_chart.rst

Lines changed: 81 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,30 @@ Example:
99

1010
.. code-block:: php
1111
12-
$chartShape = $slide->createChartShape();
13-
12+
$chartShape = $slide->createChartShape();
13+
1414
Parts
15-
-------
15+
-----
16+
17+
Axis
18+
^^^^
19+
20+
You can define gridlines (minor and major) for each axis (X & Y).
21+
For each gridline, you can custom the width (in points), the fill type and the fill color.
22+
23+
.. code-block:: php
24+
25+
use \PhpOffice\PhpPresentation\Shape\Chart\Gridlines;
26+
27+
$oLine = new Line();
28+
29+
$oGridLines = new Gridlines();
30+
$oGridLines->getOutline()->setWidth(10);
31+
$oGridLines->getOutline()->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color(Color::COLOR_BLUE));
32+
33+
$oShape = $oSlide->createChartShape();
34+
$oShape->getPlotArea()->setType($oLine);
35+
$oShape->getPlotArea()->getAxisX()->setMajorGridlines($oGridLines);
1636
1737
Title
1838
^^^^^
@@ -22,14 +42,56 @@ For hiding it, you define its visibility to false.
2242

2343
.. code-block:: php
2444
25-
$chartShape = $slide->createChartShape();
26-
$oLine = new Line();
27-
$oShape->getPlotArea()->setType($oLine);
28-
// Hide the title
29-
$oShape->getTitle()->setVisible(false);
30-
45+
$oLine = new Line();
46+
$oShape = $slide->createChartShape();
47+
$oShape->getPlotArea()->setType($oLine);
48+
// Hide the title
49+
$oShape->getTitle()->setVisible(false);
50+
51+
Series
52+
^^^^^^
53+
54+
You can custom the font of a serie.
55+
56+
.. code-block:: php
57+
$oSeries = new Series('Downloads', $seriesData);
58+
// Define the size
59+
$oSeries->getFont()->setSize(25);
60+
61+
You can custom the marker of a serie, for Line & Scatter charts.
62+
63+
.. code-block:: php
64+
use \PhpOffice\PhpPresentation\Shape\Chart\Marker;
65+
66+
$oSeries = new Series('Downloads', $seriesData);
67+
$oMarker = $oSeries->getMarker();
68+
$oMarker->setSymbol(Marker::SYMBOL_DASH)->setSize(10);
69+
70+
You can custom the line of a serie, for Line & Scatter charts.
71+
72+
.. code-block:: php
73+
use \PhpOffice\PhpPresentation\Style\Outline;
74+
75+
$oOutline = new Outline();
76+
// Define the color
77+
$oOutline->getFill()->setFillType(Fill::FILL_SOLID);
78+
$oOutline->getFill()->setStartColor(new Color(Color::COLOR_YELLOW));
79+
// Define the width (in points)
80+
$oOutline->setWidth(2);
81+
82+
$oSeries = new Series('Downloads', $seriesData);
83+
$oSeries->setOutline($oOutline);
84+
85+
You can define the position of the data label.
86+
Each position is described in `MSDN <https://msdn.microsoft.com/en-us/library/mt459417(v=office.12).aspx>`_
87+
88+
.. code-block:: php
89+
90+
$oSeries = new Series('Downloads', $seriesData);
91+
$oSeries->setLabelPosition(Series::LABEL_INSIDEEND);
92+
3193
Types
32-
-------
94+
-----
3395

3496
Area
3597
^^^^
@@ -46,15 +108,15 @@ You can stack multiples series in a same chart. After adding multiples series, y
46108

47109
.. code-block:: php
48110
49-
$oBarChart = new Bar();
50-
$oBarChart->addSeries($oSeries1);
51-
$oBarChart->addSeries($oSeries2);
52-
$oBarChart->addSeries($oSeries3);
53-
$oBarChart->setBarGrouping(Bar::GROUPING_CLUSTERED);
54-
// OR
55-
$oBarChart->setBarGrouping(Bar::GROUPING_STACKED);
56-
// OR
57-
$oBarChart->setBarGrouping(Bar::GROUPING_PERCENTSTACKED);
111+
$oBarChart = new Bar();
112+
$oBarChart->addSeries($oSeries1);
113+
$oBarChart->addSeries($oSeries2);
114+
$oBarChart->addSeries($oSeries3);
115+
$oBarChart->setBarGrouping(Bar::GROUPING_CLUSTERED);
116+
// OR
117+
$oBarChart->setBarGrouping(Bar::GROUPING_STACKED);
118+
// OR
119+
$oBarChart->setBarGrouping(Bar::GROUPING_PERCENTSTACKED);
58120
59121
- Bar::GROUPING_CLUSTERED
60122
.. image:: images/chart_columns_52x60.png

0 commit comments

Comments
 (0)