Location: PHPKode > scripts > OpenOffice 2 HTML > openoffice-2-html/docs.html
    <title>OpenOffice2HTML ver 0.1.1 class DOCS</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <body bgcolor="#DDDDDD">
<font size="2">
<center><h1>OpenOffice2HTML ver 0.1.1 class DOCS</h1></center>
<B>AUTHOR</B>: Piotr Maliński<BR>
<B>Contact</B>: <a href="mailto:hide@address.com">hide@address.com</a><BR>
<B>Site</B>: <a href="http://www.english.rk.edu.pl">http://www.english.rk.edu.pl</a> | <a href="http://www.cms.rk.edu.pl">http://www.cms.rk.edu.pl</a> - Polish<BR>
<B>License</B>: GPL<BR>
<B>Requirements</B>: PHP5 + simpleXML (and PECL ZIP extension is recommended)<BR>
<B>Update 22.10.2005 (0.1.1)</B>: Added AbiWord support, few fixes in CSS generation from OASIS OpenDocument (OOffice 2), integration of PECL ZIP extension.<BR><BR>

This class can extract data from OpenOffice 1.* and 2.* files (OOffice Writer - *.sxv or *.odt files) and AbiWord .abw files.<BR>
Currently only simple text/image styles can be converted (bold, italic, unterline, align, font size, font name etc.). Also tables should be converted but without any styles.<BR>
OpenOffice files are ZIP files (special subtype), just change their extension to zip and unzip it :) You will get some *.xml files and folders. The class can't extract zip files but you can use like PclZip (http://www.phpconcept.net) to extract data from a ZIP/OOffice file via PHP. If you want something better try PECL extension.<BR>
AbiWord is a small but usefull WYSIWYG editor that runs on Windows or Linux/Unix. *.abw files are plain XML files. This class can convert AbiWord files into HTML (with limited styles conversion).<BR><BR>

You need an AbiWord file or OpenOffice one. If you want to convert OOffice files the you will need a "ZIP" PECL extension or you will have to manualy (or via other PHP way) extract OpenOffice file.<BR>
<B>Examples</B> with comments are in test.zip file.


<B><font color="blue">oo_unzip($file, $save = false)</font></B> - $file is a patch to OpenOffice file. IF $save is not false then content.xml and Pictures/ will be saved in the current folder (you have to have write permissions). IF $save is false the it will return an array <B>array($content, $img);</B> where $content is the content of content.xml and $img is an array with images (if any) where Keys are filenames, values - image files content.<BR><BR>
<B><font color="blue">oo_convert($content, $ver)</font></B> - $content - patch to content.xml or it content (like from oo_unzip without save), $ver - OpenOffice version - 1 for old <B>sxv</B> files, 2 for OASIS <B>odt</B> files. IT will return an array: <B>array($r_styles, $r_text);</B> where $r_styles - CSS styles, $r_text - converted text, will return <B>false</B> on errors.<BR><BR>
<B><font color="blue">oo_to_file($filename, $content, $ver)</font></B> - Saves the converted document to a HTML files. $filename - name of the output HTML file, $content, $ver - like in oo_convert(). Returns true on succes.<BR><BR>
<B><font color="blue">oo_on_screen($content, $ver)</font></B> - returns a string with converted document. $content, $ver - like in oo_convert()<BR><BR>
<B><font color="blue">abi_on_screen($filename, $patch = './')</font></B> - Converts AbiWord file and show the results (returns a string). $filename - patch to abiword file, $patch - where to save images (a patch)

- More styles for OOffice Writer<BR>
- Check other OOffice files like Calc...<BR>

Return current item: OpenOffice 2 HTML