cvs: peardoc /en/package fileformats-entities.xml /en/package/fileformats opendocument.xml /en/package/fileformats/opendocument/text intro.xml
/en/package/fileformats/opendocument/text/examples intro.php

From: Date: Wed, 10 Jun 2009 04:28:30 +0000
Subject: cvs: peardoc /en/package fileformats-entities.xml /en/package/fileformats opendocument.xml /en/package/fileformats/opendocument/text intro.xml
/en/package/fileformats/opendocument/text/examples intro.php
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-11662@lists.php.net to get a copy of this message
cweiske Wed Jun 10 04:28:30 2009 UTC Added files: /peardoc/en/package/fileformats opendocument.xml /peardoc/en/package/fileformats/opendocument/text intro.xml /peardoc/en/package/fileformats/opendocument/text/examples intro.php Modified files: /peardoc/en/package fileformats-entities.xml Log: Add first OpenDocument example http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats-entities.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/fileformats-entities.xml diff -u peardoc/en/package/fileformats-entities.xml:1.1 peardoc/en/package/fileformats-entities.xml:1.2 --- peardoc/en/package/fileformats-entities.xml:1.1 Sat Oct 11 23:10:03 2008 +++ peardoc/en/package/fileformats-entities.xml Wed Jun 10 04:28:29 2009 @@ -9,4 +9,5 @@ &package.fileformats.file-marc; &package.fileformats.file-passwd; &package.fileformats.mp3-id; +&package.fileformats.opendocument; &package.fileformats.spreadsheet-excel-writer; http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/opendocument.xml?view=markup&rev=1.1 Index: peardoc/en/package/fileformats/opendocument.xml +++ peardoc/en/package/fileformats/opendocument.xml <?xml version="1.0" encoding="utf-8"?> <book xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.fileformats.opendocument" > <info> <title>OpenDocument</title> <abstract> <para> The OpenDocument package lets you create office files according to the OASIS OpenDocument specification. As of version 0.1.2, only text documents can be created. </para> </abstract> </info> &package.fileformats.opendocument.text.intro; </book> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/opendocument/text/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/fileformats/opendocument/text/intro.xml +++ peardoc/en/package/fileformats/opendocument/text/intro.xml <?xml version="1.0" encoding="utf-8"?> <chapter xmlns="http://docbook.org/ns/docbook" xmlns:phd="http://www.php.net/ns/phd" version="lillet" xml:id="package.fileformats.opendocument.text.intro" > <info> <title>Creating a first text document</title> </info> <para> Creating an OpenDocument text document is really simple. </para> <programlisting role="php"> <xi:include parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" href="&package.fileformats.opendocument.text.examples.intro.php;" > <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback> </xi:include> </programlisting> <para> After creating an OpenDocument instance, there are several <phd:pearapi phd:package="OpenDocument" phd:linkend="OpenDocument">methods</phd:pearapi> available to create actual content; all of them are prefixed with <literal>create</literal>. </para> <para> All of those methods return the created object. This object has already been inserted at the end of the document. </para> <para> The newly created element may have some <literal>create*()</literal> methods of its own - a <phd:pearapi phd:package="OpenDocument" phd:linkend="OpenDocument_Paragraph">paragraph</phd:pearapi> for example allows you to add <phd:pearapi phd:package="OpenDocument" phd:linkend="OpenDocument_Paragraph::createHyperlink">links</phd:pearapi> and <phd:pearapi phd:package="OpenDocument" phd:linkend="OpenDocument_Paragraph::createTextElement">additional text elements</phd:pearapi>. </para> <para> When you are done, call <phd:pearapi phd:package="OpenDocument" phd:linkend="OpenDocument_Paragraph::save"/> with the filename as only parameter to store the document on disk. </para> <note> <para> Until version 0.1.2, only relative filenames are allowed. </para> </note> </chapter> http://cvs.php.net/viewvc.cgi/peardoc/en/package/fileformats/opendocument/text/examples/intro.php?view=markup&rev=1.1 Index: peardoc/en/package/fileformats/opendocument/text/examples/intro.php +++ peardoc/en/package/fileformats/opendocument/text/examples/intro.php <?php /** * This script demonstrates how to create a new text document by * adding a headline and a paragraph containing a link. */ require_once 'OpenDocument.php'; $doc = new OpenDocument(); $doc->createHeading('Welcome to OpenDocument!', 1); $p = $doc->createParagraph('This script serves as a demonstration of PEAR\'s OpenDocument package. You are invited to explore the capabilities of this package and to read the API documentation available at '); $p->createHyperlink('pear.php.net', 'http://pear.php.net/package/OpenDocument'); $p->createTextElement('. Have fun!'); $doc->save('my-first-document.odt'); ?>

« previous php.pear.doc (#11662) next »