Skip to content

Commit 284fdac

Browse files
committed
Doc: Update manual & README.md
1 parent e373315 commit 284fdac

File tree

2 files changed

+139
-31
lines changed

2 files changed

+139
-31
lines changed

Documentation/PHPPowerPoint Manual.md

Lines changed: 105 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# PHPPowerPoint
1+
# PHPPowerPoint Manual
22

3-
PHPPowerPoint is a library written in pure PHP that provides a set of classes to write to and read from different presentation file formats. PHPPowerPoint is an open source project licensed under LGPL.
3+
PHPPowerPoint is a library written in pure PHP that provides a set of classes to write to and read from different presentation file formats, i.e. OpenXML (.pptx) and OpenDocument (.odp). PHPPowerPoint is an open source project licensed under LGPL.
4+
5+
## Overview
46

57
### Features
68

@@ -75,21 +77,73 @@ $shape = $slide->createRichTextShape();
7577

7678
Shapes are objects that can be added to a slide. There are five types of shapes that can be used, i.e. rich text, line, chart, drawing, and table.
7779

78-
```php
79-
$richText = $slide->createRichTextShape();
80-
$line = $slide->createLineShape();
81-
```
82-
83-
Below are the methods of slide that can be used to create shapes.
80+
To create a shape, use the following methods of a slide.
8481

8582
- `createRichTextShape`
8683
- `createLineShape`
8784
- `createChartShape`
8885
- `createDrawingShape`
8986
- `createTableShape`
9087

88+
Example:
89+
90+
```php
91+
$richText = $slide->createRichTextShape();
92+
$line = $slide->createLineShape();
93+
```
94+
95+
Every shapes have common properties that you can set by using fluent interface.
96+
97+
- `width` in pixels
98+
- `height` in pixels
99+
- `offsetX` in pixels
100+
- `offsetY` in pixels
101+
- `rotation` in degrees
102+
- `fill`
103+
- `border`
104+
- `shadow`
105+
- `hyperlink`
106+
107+
Example:
108+
109+
```php
110+
$richtext = $slide->createRichTextShape()
111+
->setHeight(300)
112+
->setWidth(600)
113+
->setOffsetX(170)
114+
->setOffsetY(180);
115+
```
116+
91117
#### Rich text
92118

119+
Rich text shapes contain paragraphs of texts. Below are the properties that you can set for a rich text shape.
120+
121+
- `wrap`
122+
- `autoFit`
123+
- `horizontalOverflow`
124+
- `verticalOverflow`
125+
- `upright`
126+
- `vertical`
127+
- `columns`
128+
- `bottomInset` in pixels
129+
- `leftInset` in pixels
130+
- `rightInset` in pixels
131+
- `topInset` in pixels
132+
133+
Example:
134+
135+
```php
136+
$richtext = $slide->createRichTextShape()
137+
->setWrap(PHPPowerPoint_Shape_RichText::WRAP_SQUARE)
138+
->setBottomInset(600);
139+
```
140+
141+
Properties that can be set for each paragraphs are as follow.
142+
143+
- `alignment`
144+
- `font`
145+
- `bulletStyle`
146+
93147
#### Line
94148

95149
#### Chart
@@ -100,9 +154,46 @@ Below are the methods of slide that can be used to create shapes.
100154

101155
### Styles
102156

103-
- Alignment
104-
- Border
105-
- Bullet
106-
- Color
107-
- Fill
108-
- Font
157+
#### Fill
158+
159+
- `fillType`
160+
- `rotation`
161+
- `startColor`
162+
- `endColor`
163+
164+
#### Border
165+
166+
- `lineWidth`
167+
- `lineStyle`
168+
- `dashStyle`
169+
- `color`
170+
171+
#### Alignment
172+
173+
- `horizontal`
174+
- `vertical`
175+
- `level`
176+
- `indent`
177+
- `marginLeft`
178+
- `marginRight`
179+
180+
#### Font
181+
182+
- `name`
183+
- `bold`
184+
- `italic`
185+
- `superScript`
186+
- `subScript`
187+
- `underline`
188+
- `strikethrough`
189+
- `color`
190+
191+
#### Bullet
192+
193+
- `bulletType`
194+
- `bulletFont`
195+
- `bulletChar`
196+
- `bulletNumericStyle`
197+
- `bulletNumericStartAt`
198+
199+
#### Color

README.md

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
1-
# PHPPowerPoint - OpenXML - Read, Write and Create PowerPoint documents in PHP
1+
# ![PHPPowerPoint](https://github.com/PHPOffice/PHPPowerPoint/raw/master/Documentation/assets/PHPPowerPointLogo.png "PHPPowerPoint")
22

3-
Project providing a set of classes for the PHP programming language, which allow you to write to and read from different file formats, like PowerPoint 2007, ... This project is built around Microsoft's OpenXML standard and PHP.
4-
Checkout the Features this class set provides, such as setting presentation meta data (author, title, description, ...), adding slides, adding images to your presentation and much, much more!
3+
[![Build Status](https://travis-ci.org/PHPOffice/PHPPowerPoint.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPPowerPoint)
54

6-
## Want to contribute?
75

8-
Fork us!
6+
PHPPowerPoint is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. OpenXML (.pptx) and OpenDocument (.odp). PHPPowerPoint is an open source project licensed under [LGPL](LICENSE.md).
97

10-
## Requirements
8+
### Features
9+
10+
- Create an in-memory presentation representation
11+
- Set presentation meta data (author, title, description, etc)
12+
- Add slides from scratch or from existing one
13+
- Supports different fonts and font styles
14+
- Supports different formatting, styles, fills, gradients
15+
- Supports hyperlinks and rich-text strings
16+
- Add images with different styles (positioning, rotation, shadow)
17+
- Set printing options (header, footer, page margins, paper size, orientation)
18+
- Output to different file formats: PowerPoint 2007 (.pptx), OpenDocument Presentation (.odp), Serialized Spreadsheet)
19+
- ... and lots of other things!
20+
21+
### Requirements
1122

1223
The following requirements should be met prior to using PHPPowerPoint:
1324

14-
* PHP version 5.2 or higher
15-
* PHP extension php_zip enabled
16-
* PHP extension php_xml enabled
25+
- PHP version 5.2 or higher
26+
- PHP extension php_zip enabled
27+
- PHP extension php_xml enabled
1728

18-
## Installation
29+
### Installation
1930

20-
Installation is quite easy: copy the contents of the Classes folder to any location
21-
in your application required.
31+
To install and use PHPPowerPoint, copy the contents of the `Classes` folder and include `PHPPowerPoint.php` somewhere in your code like below.
2232

23-
Afterwards, make sure you can include all PHPPowerPoint files. This can be achieved by
24-
respecting a base folder structure, or by setting the PHP include path, for example:
33+
```php
34+
include_once '/path/to/Classes/PHPPowerPoint.php';
35+
```
36+
37+
After that, you can use the library by creating a new instance of the class.
2538

2639
```php
27-
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/PHPPowerPoint/');
40+
$phpPowerPoint = new PHPPowerPoint();
2841
```
2942

30-
## License
43+
### Want to learn more?
44+
45+
[Read the manual](Documentation/PHPPowerPoint Manual.md).
46+
47+
### Want to contribute?
3148

32-
PHPPowerPoint is licensed under [LGPL (GNU LESSER GENERAL PUBLIC LICENSE)](LICENSE.md)
49+
[Fork us on GitHub](https://github.com/PHPOffice/PHPPowerPoint)!

0 commit comments

Comments
 (0)