<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>clPHPppt - the PowerPoint PHP Class</title>
<link rel="stylesheet" type="text/css" href="media/style.css">
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
<tr>
<td class="header-top-left"><img src="media/logo.png" border="0" alt="phpDocumentor " /></td>
<td class="header-top-right">clPHPppt<br /><div class="header-top-right-subpackage"></div></td>
</tr>
<tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
<tr>
<td colspan="2" class="header-menu">
[ <a href="classtrees_clPHPppt.html" class="menu">class tree: clPHPppt</a> ]
[ <a href="elementindex_clPHPppt.html" class="menu">index: clPHPppt</a> ]
[ <a href="elementindex.html" class="menu">all elements</a> ]
</td>
</tr>
<tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="195" class="menu">
<div class="package-title">clPHPppt</div>
<div class="package">
<div id="todolist">
<p><a href="todolist.html">Todo List</a></p>
</div>
</div>
<b>Packages:</b><br />
<div class="package">
<a href="li_clPHPppt.html">clPHPppt</a><br />
</div>
<br />
<b>Tutorials/Manuals:</b><br />
<div class="package">
<strong>Package-level:</strong>
<ul>
<li type="square"><a href="clPHPppt/tutorial_clPHPppt.pkg.html">clPHPppt documentation</a>
<ul>
<li type="square"><a href="clPHPppt/tutorial_sample1.pkg.html">Source code for sample1.php</a>
</ul>
</li></ul>
<b>Files:</b><br />
<div class="package">
<span style="padding-left: 1em;"><a href="clPHPppt/_clPHPppt.php.html">clPHPppt.php</a></span><br />
<span style="padding-left: 1em;"><a href="clPHPppt/_clPHPppt_constants.php.html">clPHPppt_constants.php</a></span><br />
</div>
<br />
<b>Classes:</b><br />
<div class="package">
<a href="clPHPppt/clPHPppt.html">clPHPppt</a> <br />
<a href="clPHPppt/ppArrowLengths.html">ppArrowLengths</a> <br />
<a href="clPHPppt/ppArrowStyles.html">ppArrowStyles</a> <br />
<a href="clPHPppt/ppArrowWidths.html">ppArrowWidths</a> <br />
<a href="clPHPppt/ppAutoShapeTypes.html">ppAutoShapeTypes</a> <br />
<a href="clPHPppt/ppConstants.html">ppConstants</a> <br />
<a href="clPHPppt/ppLineDashStyles.html">ppLineDashStyles</a> <br />
<a href="clPHPppt/ppLineStyles.html">ppLineStyles</a> <br />
<a href="clPHPppt/ppShadowTypes.html">ppShadowTypes</a> <br />
<a href="clPHPppt/ppSlideLayouts.html">ppSlideLayouts</a> <br />
<a href="clPHPppt/ppTextAligns.html">ppTextAligns</a> <br />
<a href="clPHPppt/ppTextEffectStyles.html">ppTextEffectStyles</a> <br />
<a href="clPHPppt/ppVerticalAnchor.html">ppVerticalAnchor</a> <br />
</div>
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<div><a name=""></a><div class="ref-title-box"><h1 class="ref-title">clPHPppt documentation</h1>
<h2 class="ref-purpose">The documentation for the PHP Microsoft PowerPoint wrapper class!</h2></div>
<div class="ref-synopsis"><strong>by <span class="author">Christian Arnold
<div class="author-blurb"><a href="mailto:christian-hide@address.com">christian-hide@address.com</a></div></span></strong></div>
<h1 align="center">Table of Contents</h1>
<ul>
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#intro">Introduction</a><br />
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#sysreq">System Requirements</a><br />
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#quickstart">Quick Start</a><br />
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#quickstart.download">Download</a><br />
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#quickstart.include">Include</a><br />
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#quickstart.use">Use</a><br />
<a href="clPHPppt/tutorial_clPHPppt.pkg.html#quickstart.create">Create!</a><br />
</ul>
<span><a name="intro"></a><h2 class="title">Introduction</h2><p>This is the documentation for the PHP Microsoft PowerPoint wrapper class. clPHPppt can do
nothing more than the powerpoint.application PHP COM object does, because clPHPppt just uses
it. But it makes it easier for you to create or modify a PowerPoint presentation. The clPHPppt
Class is currently in some kind of alpha stage and is developed by Christian Arnold. If you
find any bugs or have a certain feature request, just use the bug tracking service of
<a href="https://sourceforge.net/tracker/?group_id=240752">sourceforge.net</a>.</p>
<p>Okay, lets get started. But check the System Requirements first!</p></span>
<span><a name="sysreq"></a><h2 class="title">System Requirements</h2><ul><li><p>Microsoft Windows Operating System</p></li>
<li><p>PHP with COM either compiled in or as a loadable extension</p></li>
<li><p>Microsoft PowerPoint installed on the server</p></li></ul></span>
<span><a name="quickstart"></a><h2 class="title">Quick Start</h2><p>Here you will find a step by step guide on how to create your first powerpoint presentation
with clPHPppt. But before you start make sure you have read the system requirements first!</p>
<a name="quickstart.download"></a><h3 class="title">Download</h3><p>At first, you have to get clPHPppt of course. Either you download a release from
<a href="https://sourceforge.net/project/showfiles.php?group_id=240752">sourceforge.net</a> or if
there is something special in the SVN you need, you can
<a href="https://sourceforge.net/svn/?group_id=240752">check out</a> from there.</p><hr />
<a name="quickstart.include"></a><h3 class="title">Include</h3><p>The next step is to include the main clPHPppt.php file into your project. Now you have access
to the class. The clPHPppt_constants.php is automatically included.</p>
<p>Now you can use
<ol><li><div class="src-line"><span class="src-var">$ppt </span>= <span class="src-key">new </span><span class="src-id"><a href="clPHPppt/clPHPppt.html">clPHPppt</a></span><span class="src-sym">(</span><span class="src-var">$visible</span><span class="src-sym">, </span><span class="src-var">$openFilename</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
to create or open a new presentation. On most configurations you have to set
<strong>$visible</strong> to true. Also on Windows Server this is the most case. And
even no one is logged in, it will always work with $visible = true.
<strong>$openFilename</strong> is an optional parameter. You can use it to open an
already created PowerPoint file or a template to start a new one. But you have to include
the full path on the server to the file, only using "companyTemplate.pot" will result in a
file-not-found-error.</p>
<p>If you use a PHP IDE which supports some kind of CodeInsight Technology, I advise you to
create the next class, the ppConstants. As it sounds it has all the constants to easy select
the slide layout you want without searching for the correct index PowerPointuses for
instance. You can create the class with:
<ol><li><div class="src-line"><span class="src-var">$ppConstants </span>= <span class="src-key">new </span><span class="src-id"><a href="clPHPppt/ppConstants.html">ppConstants</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
Now you have access to the possible constants in <a href="clPHPppt/ppConstants.html">$ppConstants</a>, but be aware, that it is
called constant, but internaly these are ordinary public variables in a class which
could be changed from outside. If you have an idea to solve this problem, please contac me!</p><hr />
<a name="quickstart.use"></a><h3 class="title">Use</h3><p>Now you can start using clPHPppt. Lets say, you want to add a new slide to the new
presentation you have just created. Therefore you have to use the <a href="clPHPppt/clPHPppt.html#methodaddSlide">addSlide()</a>
method. This is how it could look like:
<ol><li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">addSlide</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">, </span><span class="src-var">$ppConstants</span><span class="src-sym">-></span><span class="src-id"><a href="clPHPppt/ppSlideLayouts.html">ppSlideLayouts</a></span><span class="src-sym">-></span><span class="src-id">ppLayoutTitle</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
This would create a slide at index 1 with the title layout. You can add and also
<a href="clPHPppt/clPHPppt.html#methoddelSlide">delete</a> slides as you like at anytime between the clPHPppt creation and
the save call.</p>
<p>If you want to change the text of the two placeholders automaticaly created by the title
layout, you have to use the <a href="clPHPppt/clPHPppt.html#methodsetShapeText">stShapeText</a> method:
<ol><li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">setShapeText</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">,</span><span class="src-str">"Welcome to clPHPppt"</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">setShapeText</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,</span><span class="src-num">2</span><span class="src-sym">,</span><span class="src-str">"The Microsoft® PowerPoint® PHP Class"</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
The first parameter describes the slide number, the second the shape number and the last
which text you want to set. setShapeText also can receive a fourth parameter, but we will
come to that one later.</p>
<p>Now you maybe have created a slide with the text layout. And how can you make a bullet list?
It's easy! Just use \r\n as a line break after each paragraph. To indent some lines is also
very easy:
<ol><li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">setIndent</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">//No Level for the first Object</span></div></li>
<li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">setIndent</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">, </span><span class="src-num">5</span><span class="src-sym">, </span><span class="src-num">6</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">//Paragraphs 5 to 10 should be on the second level</span></div></li>
</ol>
You give the <a href="clPHPppt/clPHPppt.html#methodsetIndent">setIndent()</a> method a few parameters, the rest is done for
you. The parameters are these:
<ul><li><p>Slide number</p></li>
<li><p>Shape number</p></li>
<li><p>Start paragraph</p></li>
<li><p>Count of paragraphs</p></li>
<li><p>Indent level and</p></li>
<li><p>Bullet type</p></li></ul>
For the last there will be a constants list in the next release. And between you and me, the
bullet and zero-level is currently not working. But it will, in the next release! But pshhhh...</p>
<p>Let's add something special! How about a simple text box? This can be done with the
<a href="clPHPppt/clPHPppt.html#methodaddTextbox">addTextBox()</a> method:
<ol><li><div class="src-line"><span class="src-var">$settings </span>= <span class="src-key">array </span><span class="src-sym">(</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontName' </span>=> <span class="src-str">'Verdana'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontSize' </span>=> <span class="src-num">24</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontBold' </span>=> <span class="src-id">false</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontItalic' </span>=> <span class="src-id">false</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontShadow' </span>=> <span class="src-id">true</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontUnderline' </span>=> <span class="src-id">true</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fontColor' </span>=> <span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">getVBColorFromRGB</span><span class="src-sym">(</span><span class="src-num">15</span><span class="src-sym">,</span><span class="src-num">45</span><span class="src-sym">,</span><span class="src-num">128</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'textAlign' </span>=> <span class="src-var">$ppConstants</span><span class="src-sym">-></span><span class="src-id"><a href="clPHPppt/ppTextAligns.html">ppTextAligns</a></span><span class="src-sym">-></span><span class="src-id">ppTextAlignCenter</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'rotation' </span>=> <span class="src-num">15</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fillEnabled' </span>=> <span class="src-id">true</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fillForeColor' </span>=> <span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">getVBColorFromRGB</span><span class="src-sym">(</span><span class="src-num">128</span><span class="src-sym">,</span><span class="src-num">45</span><span class="src-sym">,</span><span class="src-num">15</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"> <span class="src-str">'fillTransparency' </span>=> <span class="src-num">0.8</span></div></li>
<li><div class="src-line"><span class="src-sym">)</span><span class="src-sym">; </span></div></li>
<li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">addTextbox</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">, </span><span class="src-str">"Test TexBox"</span><span class="src-sym">, </span><span class="src-num">275</span><span class="src-sym">, </span><span class="src-num">175</span><span class="src-sym">, </span><span class="src-num">300</span><span class="src-sym">, </span><span class="src-num">40</span><span class="src-sym">, </span><span class="src-var">$settings</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
The first parameter, what could it be? Right, the slide number. After that comes the Text
you want to set to the fresh and tasty text box. The next four parameters describe left and
top distance and width and height for the textbox. But hey, what's that
<strong>$settings</strong>? That's what I talked about at the setShapeText() method
above. With the $settings parameter you can alter the properties of a shape as you like.
Have a look at <a href="clPHPppt/clPHPppt.html#methodapplySettings">applySettings()</a> method to see which properties you
can change.</p>
<p>Finally, you can save the PowerPoint slide with the <a href="clPHPppt/clPHPppt.html#methodsave">save()</a> method:
<ol><li><div class="src-line"><span class="src-var">$ppt</span><span class="src-sym">-></span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-var">$saveFilename</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
Just call it with a complete path and filename as parameter, the rest does PowerPoint for
you. When the script ends, PowerPoint will close itself automatically. But if you scripted
something wrong, it will remain open so you can easily analyze, what went wrong.</p><hr />
<a name="quickstart.create"></a><h3 class="title">Create!</h3><p>Now go out and make some great presentations! All the other objects you can create
with clPHPppt are used like the way we just used in this small tutorial. Just have a look
at the sample1.php included in the source and search this documentation</p>
<p>And if you find that something is missing, fill a feature request at
<a href="https://sourceforge.net/tracker/?group_id=240752">sourceforge.net</a>!</p><hr /></span></div>
<div class="credit">
<hr class="separator" />
Documentation generated on Wed, 01 Oct 2008 11:17:57 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>
</tr>
</table>
</body>
</html>