incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r795380 [2/2] - /websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/
Date Tue, 06 Sep 2011 10:20:37 GMT
Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,143 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Style Handling.html">Style Handling</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Charts.html">previous</a></li>
+  <li><a href="Manipulate TextSearch.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Overview" >Overview</a></strong>
+<hr/>
+<div class="bodytext">
+Style handling methods provide convenient methods to set font and borders.
+</div>
+<strong><a href="#Font handling" >Font handling</a></strong>
+<hr/>
+<div class="bodytext">
+        The most simple method to define font settings is to create a font      object, and set it to a cell object.        The below code snippet defines a font object to describe "Arial"        italic font with size "12pt" and black color,       and then set it to a cell. The font will work for western characters        by default.
+</div>
+<br/><pre class='code' id="code0">
+        <span class='javaclass'>SpreadsheetDocument</span> document = <span class='javaclass'>SpreadsheetDocument</span>.newSpreadsheetDocument();<br/>
+        <span class='javaclass'>Table</span> table = document.getTableByName("Sheet1");<br/>
+        <span class='javaclass'>Font</span> font = <span class='modifier'>new</span> <span class='javaclass'>Font</span>("<span class='javaclass'>Arial</span>", <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>FontStyle</span>.<span class='javaclass'>ITALIC</span>, 12, <span class='javaclass'>Color</span>.<span class='javaclass'>BLACK</span>);<br/>
+        <span class='javaclass'>Cell</span> cell = table.getCellByPosition("A1");<br/>
+        cell.setFont(font);<br/>
+</pre>
+<br/><div class="bodytext">
+        The most simple method to get font settings of western characters is:
+</div>
+<br/><pre class='code' id="code1">
+        <span class='javaclass'>Font</span> theFont = cell.getFont();<br/>
+        <span class='basic'>double</span> size = theFont.getSize();<br/>
+        <span class='javaclass'>String</span> fontName = theFont.getFamilyName();<br/>
+        <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>FontStyle</span> fontStyle = theFont.getFontStyle();<br/>
+        <span class='javaclass'>Color</span> fontColor = theFont.getColor();<br/>
+</pre>
+<br/><strong><a href="#Advanced font handling" >Advanced font handling</a></strong>
+<hr/>
+<div class="bodytext">
+        <i>CellStyleHandler</i> can help you to achieve advanced functions.     In Open Document Format, there can be different font settings for       different script types.         For example, a font setting for English characters and another font     setting for Chinese characters.     If you want to define the font setting for other script types, you      can reference to below codes.       The below code snippet defines a font for Chinese characters.
+</div>
+<br/><pre class='code' id="code2">
+        cell.getStyleHandler().setFont(font, <span class='modifier'>new</span> <span class='javaclass'>Locale</span>(<span class='javaclass'>Locale</span>.<span class='javaclass'>CHINESE</span>.getLanguage(), <span class='javaclass'>Locale</span>.<span class='javaclass'>CHINA</span>.getCountry()));<br/>
+</pre>
+<br/><div class="bodytext">
+        The below code snippet shows how to get the font setting for other kinds of scripts.
+</div>
+<br/><pre class='code' id="code3">
+        <span class='javaclass'>CellStyleHandler</span> styleHandler = cell.getStyleHandler();<br/>
+        <span class='javaclass'>Font</span> westernFont = styleHandler.getFont(<span class='javaclass'>Document</span>.<span class='javaclass'>ScriptType</span>.<span class='javaclass'>WESTERN</span>);<br/>
+        <span class='javaclass'>Font</span> chineseFont = styleHandler.getFont(<span class='javaclass'>Document</span>.<span class='javaclass'>ScriptType</span>.<span class='javaclass'>CJK</span>);<br/>
+        <span class='javaclass'>Font</span> complexFont = styleHandler.getFont(<span class='javaclass'>Document</span>.<span class='javaclass'>ScriptType</span>.<span class='javaclass'>CTL</span>);<br/>
+</pre>
+<br/><strong><a href="#Border handling" >Border handling</a></strong>
+<hr/>
+<div class="bodytext">
+        The most simple way to set border is to create a border object and      then set it to a cell object.       Below code snippet illustrates how to set a cell object with four       borders.
+</div>
+<br/><pre class='code' id="code4">
+        cell = table.getCellByPosition("A1");<br/>
+        cell.setStringValue("four border");<br/>
+        <span class='javaclass'>Border</span> border = <span class='modifier'>new</span> <span class='javaclass'>Border</span>(<span class='javaclass'>Color</span>.<span class='javaclass'>RED</span>, 1, <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>SupportedLinearMeasure</span>.<span class='javaclass'>PT</span>);<br/>
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.ALL_FOUR, border);<br/>
+</pre>
+<br/><div class="bodytext">
+        Below code snippet illustrates how to set a cell object with left and       right borders, top and bottom borders and diagonal lines.
+</div>
+<br/><pre class='code' id="code5">
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.LEFT_RIGHT, border);<br/>
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.TOP_BOTTOM, border);<br/>
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.DIAGONAL_LINES, border);<br/>
+</pre>
+<br/><div class="bodytext">
+        Below code snippet illustrates how to set a cell object with left       border, top border and diagonal from bottom left to top right.
+</div>
+<br/><pre class='code' id="code6">
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.<span class='javaclass'>LEFT</span>, border);<br/>
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.<span class='javaclass'>TOP</span>, border);<br/>
+        cell.setBorders(<span class='javaclass'>CellBordersType</span>.<span class='javaclass'>DIAGONALBLTR</span>, border);<br/>
+</pre>
+<br/><div class="bodytext">
+        Below code snippet illustrates how to get a border definition.
+</div>
+<br/><pre class='code' id="code7">
+        <span class='javaclass'>Border</span> thisBorder = cell.getBorder(<span class='javaclass'>CellBordersType</span>.<span class='javaclass'>LEFT</span>);<br/>
+        thisBorder = cell.getBorder(<span class='javaclass'>CellBordersType</span>.<span class='javaclass'>TOP</span>);<br/>
+        thisBorder = cell.getBorder(<span class='javaclass'>CellBordersType</span>.<span class='javaclass'>DIAGONALBLTR</span>);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Charts.html">previous</a></li>
+  <li><a href="Manipulate TextSearch.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,157 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Table.html">Table</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Slide.html">previous</a></li>
+  <li><a href="Column and Row.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Overview" >Overview</a></strong>
+<hr/>
+<div class="bodytext">
+ This <a href="">Table</a> API supports to manipulate tables in text and spreadsheet documents. It covers the table definition in <a href="http:docs.oasis-open.org/office/v1.2/cd05/OpenDocument-v1.2-cd05-part1.html#a_9_Tables">ODF Specification 1.2 Committee Draft05</a>
+</div>
+<strong><a href="#Create Table" >Create Table</a></strong>
+<hr/>
+<div class="bodytext">
+Let's create an empty table first.By default,the code below create a table with 5 columns and 2 rows.
+</div>
+<br/><pre class='code' id="code0">
+            <span class='javaclass'>TextDocument</span> document = <span class='javaclass'>TextDocument</span>.newTextDocument();<br/>
+            <span class='javaclass'>Table</span> table1 = <span class='javaclass'>Table</span>.newTable(document);<br/>
+            table1.setTableName("table1");<br/>
+            document.save(filePath);<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to create table with specified column and row,you can do like this:
+</div>
+<br/><pre class='code' id="code1">
+            <span class='basic'>int</span> row=4;<br/>
+            <span class='basic'>int</span> column=3;<br/>
+            <span class='javaclass'>Table</span> table2=<span class='javaclass'>Table</span>.newTable(document, row, column);<br/>
+            table2.setTableName("table2");<br/>
+</pre>
+<br/><div class="bodytext">
+       If you want to put some numbers into a table while creating it, you can use the constructor Table.newTable(document,rowlabels,columnlabels, data)       which you should specify a 2 dimension array as the data and 2 String arrays as table labels,one for row and the other for column. 
+</div>
+<br/><pre class='code' id="code2">
+        <span class='basic'>int</span> rowcount = 10, columncount = 4;<br/>
+        <span class='basic'>double</span>[][] data = <span class='modifier'>new</span> <span class='basic'>double</span>[rowcount][columncount];    <br/>
+        <span class='javaclass'>String</span>[] rowlabels = <span class='modifier'>new</span> <span class='javaclass'>String</span>[rowcount];<br/>
+        <span class='javaclass'>String</span>[] columnlabels = <span class='modifier'>new</span> <span class='javaclass'>String</span>[columncount];<br/>
+        <span class='javaclass'>Table</span> table3=<span class='javaclass'>Table</span>.newTable(document,rowlabels,columnlabels, data);<br/>
+        table3.setTableName("dataTable");<br/>
+</pre>
+<br/><div class="bodytext">
+You can also fill table with string values while creating it, to do this you should provide a 2 dimension string array instead of double array.
+</div>
+<br/><pre class='code' id="code3">
+        <span class='javaclass'>String</span>[][] stringData = <span class='modifier'>new</span> <span class='javaclass'>String</span>[rowcount][columncount];<br/>
+        <span class='javaclass'>Table</span> table4 = <span class='javaclass'>Table</span>.newTable(document, rowlabels, columnlabels, stringData);<br/>
+        table4.setTableName("stringTable");<br/>
+</pre>
+<br/><strong><a href="#Find Table" >Find Table</a></strong>
+<hr/>
+<div class="bodytext">
+To get all the tables in the document,you can do like this:
+</div>
+<br/><pre class='code' id="code4">
+        <span class='javaclass'>List</span>&lt;<span class='javaclass'>Table</span>&gt; tableList=document.getTableList();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to get a single table,you can use the table name to find it.If it's not found,the method returns null.
+</div>
+<br/><pre class='code' id="code5">
+        <span class='javaclass'>Table</span> emptyTable=document.getTableByName("table1");<br/>
+</pre>
+<br/><strong><a href="#Delete Table" >Delete Table</a></strong>
+<hr/>
+<br/><pre class='code' id="code6">
+        <span class='javaclass'>Table</span> table = document.getTableByName("<span class='javaclass'>DeletedTable</span>");<br/>
+        <span class='control'>if</span> (table != <span class='basic'>null</span>) {<br/>
+        table.remove();<br/>
+        }<br/>
+</pre>
+<br/><strong><a href="#Set Table" >Set Table</a></strong>
+<hr/>
+<div class="bodytext">
+You can set or update table name,which can be regarded as table identifier in a document.
+</div>
+<br/><pre class='code' id="code7">
+           table1.getTableName();<br/>
+           table1.setTableName("<span class='javaclass'>EnglishScore</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to change table width,you can do like this:
+</div>
+<br/><pre class='code' id="code8">
+        <span class='javaclass'>Table</span> tableWidth=document.getTableByName("table1");<br/>
+        <span class='control'>if</span>(tableWidth!=<span class='basic'>null</span>) {<br/>
+            <span class='basic'>long</span> width=500;<br/>
+            tableWidth.setWidth(width);<br/>
+            tableWidth.getWidth();<br/>
+        }<br/>
+</pre>
+<br/><div class="bodytext">
+Each table in the document has a protect attribute to show whether it is protected or not.
+</div>
+<br/><pre class='code' id="code9">
+           <span class='basic'>boolean</span> isProtected=table1.isProtected();<br/>
+           table1.setProtected(<span class='basic'>true</span>);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Slide.html">previous</a></li>
+  <li><a href="Column and Row.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,482 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Text Document.html">Text Document</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Metadata.html">previous</a></li>
+  <li><a href="Presentation Document.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Overview" >Overview</a></strong>
+<hr/>
+<div class="bodytext">
+Till now, we support high level APIs to manipulate text document, paragraph, section, list, footer, header, textbox and span.
+</div>
+<strong><a href="#Generate TextDocument" >Generate TextDocument</a></strong>
+<hr/>
+<div class="bodytext">
+        There are typically four kinds of Text Documents with different modes can be generated: text document,      master document, template document and web document.
+</div>
+<div class="bodytext">
+The following codes generates an empty text document.
+</div>
+<br/><pre class='code' id="code0">
+            <span class='javaclass'>TextDocument</span> document1=<span class='javaclass'>TextDocument</span>.newTextDocument();     <br/>
+        document1.save(filePath);<br/>
+</pre>
+<br/><div class="bodytext">
+        There are two methods to generate a new document, one with a parameter of       OdfMediaType, and the other one just use the corresponding new function.
+</div>
+<div class="bodytext">
+        The following two lines of codes generate the same kinds of document(Master document).      The other three kinds of document are similar.
+</div>
+<br/><pre class='code' id="code1">
+        <span class='javaclass'>TextDocument</span> documentMedia1=<span class='javaclass'>TextDocument</span>.newTextDocument(<span class='javaclass'>OdfMediaType</span>.TEXT_MASTER);<br/>
+        <span class='javaclass'>TextDocument</span> documentMedia2=<span class='javaclass'>TextDocument</span>.newTextMasterDocument();<br/>
+</pre>
+<br/><strong><a href="#Get TextDocument" >Get TextDocument</a></strong>
+<hr/>
+<div class="bodytext">
+        We can get the existing Text Document by using the loadDocument function like follows.      The loadDocument function has four kinds of parameters: File, InputStream, OdfPackageDocument and       String. Here the one with string parameter is used as an example.
+</div>
+<br/><pre class='code' id="code2">
+        <span class='javaclass'>TextDocument</span> document2=(<span class='javaclass'>TextDocument</span>)<span class='javaclass'>TextDocument</span>.loadDocument("textdocument.odt");<br/>
+</pre>
+<br/><div class="bodytext">
+Also we can change the mode of one text document by using the following codes:
+</div>
+<br/><pre class='code' id="code3">
+        document2.changeMode(<span class='javaclass'>OdfMediaType</span>.TEXT_WEB);<br/>
+</pre>
+<br/><strong><a href="#Paragraph" >Paragraph</a></strong>
+<hr/>
+<div class="bodytext">
+        To add a new paragraph to a text document, the following codes can be used,     the first one add an empty paragraph to the end of the document, and the second one     add a new paragraph with the corresponding texts to the document.
+</div>
+<br/><pre class='code' id="code4">
+        document1.addParagraph(<span class='basic'>null</span>);<br/>
+        document1.addParagraph("test newParagraph function in textDocument");<br/>
+</pre>
+<br/><div class="bodytext">
+        The first one will get the second paragraph of this document. The second statement will get the last paragraph with text content.       The paragraph without text content will be ignored if the second parameter is true.
+</div>
+<div class="bodytext">
+The following codes can be used to append text to the end of a paragrah.
+</div>
+<br/><pre class='code' id="code5">
+        para1.appendTextContent("test addText function in textDocument");<br/>
+</pre>
+<br/><div class="bodytext">
+The following codes are to get and set the horizontal alignment of a paragraph.
+</div>
+<br/><pre class='code' id="code6">
+        <span class='javaclass'>HorizontalAlignmentType</span> align = para1.getHorizontalAlignment();<br/>
+        para1.setHorizontalAlignment(<span class='javaclass'>HorizontalAlignmentType</span>.<span class='javaclass'>CENTER</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+The following codes are to get and set the font of a paragraph.
+</div>
+<br/><pre class='code' id="code7">
+        <span class='javaclass'>Font</span> font = para1.getFont();<br/>
+        font.setFontStyle(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>FontStyle</span>.<span class='javaclass'>ITALIC</span>);<br/>
+        para2.setFont(font);<br/>
+</pre>
+<br/><div class="bodytext">
+The following code is to apply a hyperlink to this paragraph, and append a text with a hyperlink to this paragraph.
+</div>
+<br/><pre class='code' id="code8">
+        para2.applyHyperlink(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("mailto:daisy@odftoolkit.org"));<br/>
+        para2.appendHyperlink("mail to me",new <span class='javaclass'>URI</span>("mailto:daisy@odftoolkit.org"));<br/>
+</pre>
+<br/><div class="bodytext">
+The following code is to add a comment at the front of the paragraph.
+</div>
+<br/><pre class='code' id="code9">
+        para2.addComment("<span class='javaclass'>This</span> is a comment for para2", "<span class='javaclass'>Simple</span> <span class='javaclass'>ODF</span> <span class='javaclass'>Commenter</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+        From version 0.6.5, we support heading feature. You can test whether a paragraph is heading,        apply a plain text paragraph as heading, and get heading level.
+</div>
+<br/><pre class='code' id="code10">
+<span class='comments'>     // isHeading() and getHeadingLevel();</span>
+        <span class='control'>if</span> (para2.isHeading()) {<br/>
+            <span class='basic'>int</span> headingLevel = para2.getHeadingLevel();<br/>
+            <span class='javaclass'>System</span>.out.println("para2 is a heading, its level is " + headingLevel + ".");<br/>
+        }<br/>
+<span class='comments'>     // applyHeading(), default level is 1.</span>
+        para1.applyHeading();<br/>
+<span class='comments'>     // applyHeading(), heading level is 3.</span>
+        para1.applyHeading(<span class='basic'>true</span>, 3);<br/>
+</pre>
+<br/><strong><a href="#Section" >Section</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.4, we support high level APIs for section.       You can use the following code to get a section by name:
+</div>
+<br/><pre class='code' id="code11">
+        <span class='javaclass'>Section</span> aSection = document1.getSectionByName("<span class='javaclass'>ImageSection</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+        or use the following code to get an iterator of sections.       All sections in the document would be returned, including sections in footer and header.
+</div>
+<br/><pre class='code' id="code12">
+        <span class='javaclass'>Iterator</span>&lt;<span class='javaclass'>Section</span>&gt; sections = document1.getSectionIterator();<br/>
+        <span class='control'>while</span> (sections.hasNext()) {<br/>
+            <span class='javaclass'>Section</span> theSection = sections.next();<br/>
+        }<br/>
+</pre>
+<br/><div class="bodytext">
+        After you get the object of section,        you can use the following codes to set and get the name of the section.
+</div>
+<br/><pre class='code' id="code13">
+        <span class='javaclass'>String</span> name = aSection.getName();<br/>
+        aSection.setName("<span class='javaclass'>NewName</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+        You can use the following code to copy and append a section at the end of a document.       Copying from a foreign document is supported.       You don't need to care whether or not the document is the owner of the source section.
+</div>
+<br/><pre class='code' id="code14">
+        document1.appendSection(aSection, <span class='basic'>true</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        If you want to copy and append a section within a same document,        you can specify with the second parameter of "copyAppendSection(Section section, boolean isResourceCopied)"     whether the linked resources to this section are copied or not.     The following code means to copy a section and append it at the end, but the linked resources are shared between the source section and the copied section.
+</div>
+<br/><pre class='code' id="code15">
+        document1.appendSection(aSection, <span class='basic'>false</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can remove this Section from the document content,      all the resources that are only linked with this section would be removed too.
+</div>
+<br/><pre class='code' id="code16">
+        aSection.remove();<br/>
+</pre>
+<br/><strong><a href="#List" >List</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.4, we support high level APIs for list.      You can use the following code to create a list. The two methods are same.
+</div>
+<br/><pre class='code' id="code17">
+        <span class='javaclass'>List</span> newList1 = document1.addList();<br/>
+        <span class='javaclass'>List</span> newList2 = <span class='modifier'>new</span> <span class='javaclass'>List</span>(document1);<br/>
+</pre>
+<br/><div class="bodytext">
+        Actually, you can append list to table cell, list item, presentation slide and notes. They all have the same ability with text document for list.       We call them ListContainer, which can append, remove and get the iterator of list.
+</div>
+<br/><pre class='code' id="code18">
+        <span class='javaclass'>Iterator</span>&lt;<span class='javaclass'>List</span>&gt; lists = document1.getListIterator();<br/>
+        <span class='javaclass'>List</span> list =<span class='basic'>null</span>;<br/>
+        <span class='control'>while</span> (lists.hasNext()) {<br/>
+            list = lists.next();<br/>
+        }<br/>
+</pre>
+<br/><div class="bodytext">
+        After you get the object of list,       you can use the following methods to set and get the header of the list.
+</div>
+<br/><pre class='code' id="code19">
+        <span class='javaclass'>String</span> header = list.getHeader();<br/>
+        list.setHeader("<span class='javaclass'>NewHeader</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+        You can get all of the existing items in this list. They are returned as java.util.List.
+</div>
+<br/><pre class='code' id="code20">
+        java.util.<span class='javaclass'>List</span>&lt;<span class='javaclass'>ListItem</span>&gt; items = list.getItems();<br/>
+</pre>
+<br/><div class="bodytext">
+        If you only want to get the item at a specific location, you can use the following code:
+</div>
+<br/><pre class='code' id="code21">
+        <span class='basic'>int</span> location = 2;<br/>
+        <span class='javaclass'>ListItem</span> item = list.getItem(location);<br/>
+</pre>
+<br/><div class="bodytext">
+        There are several ways to help you append item(s) to the list. Please reference the following code:
+</div>
+<br/><pre class='code' id="code22">
+<span class='comments'>     // add single item</span>
+        <span class='javaclass'>ListItem</span> newItem1 = list.addItem(item);<br/>
+        <span class='javaclass'>ListItem</span> newItem2 = list.addItem("itemContent");<br/>
+<span class='comments'>     // add clone items</span>
+        <span class='javaclass'>ListItem</span>[] newItems = <span class='modifier'>new</span> <span class='javaclass'>ListItem</span>[]{newItem1, newItem2};<br/>
+        list.addItems(newItems);<br/>
+<span class='comments'>     // add string items</span>
+        <span class='javaclass'>String</span>[] newItemContents = <span class='modifier'>new</span> <span class='javaclass'>String</span>[]{"itemContent1", "itemContent2"};<br/>
+        list.addItems(newItemContents);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can specify a location to insert new item(s).
+</div>
+<br/><pre class='code' id="code23">
+        newItem1 = list.addItem(location, item);<br/>
+        newItem2 = list.addItem(location, "itemContent");<br/>
+        list.addItems(location, newItems);<br/>
+        list.addItems(location, newItemContents);<br/>
+</pre>
+<br/><div class="bodytext">
+        If you want to replace a list item with a new one, you can use the following code.
+</div>
+<br/><pre class='code' id="code24">
+        item = list.set(location, newItem1);<br/>
+        item = list.set(location, "itemContent");<br/>
+</pre>
+<br/><div class="bodytext">
+        You can use the following methods to remove item(s).
+</div>
+<br/><pre class='code' id="code25">
+        list.removeItem(item);<br/>
+<span class='comments'>     //item in specific location.</span>
+        list.removeItem(location);<br/>
+<span class='comments'>     //item in specific collection.</span>
+        list.removeItems(items);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can specify with the following methods whether the numbering of the previous list is continued by this list:
+</div>
+<br/><pre class='code' id="code26">
+<span class='comments'>     // the numbering of the proximate list is continued</span>
+        newList1.setContinueNumbering(<span class='basic'>true</span>);<br/>
+<span class='comments'>     // the numbering of the specified list is continued by this list</span>
+        newList2.setContinueList(list);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can use the following method to know whether the list is a number list.
+</div>
+<br/><pre class='code' id="code27">
+        <span class='javaclass'>ListType</span> type = list.getType();<br/>
+</pre>
+<br/><div class="bodytext">
+        Now, List API support 3 types of lists, ListType.BULLET, ListType.NUMBER and ListType.IMAGE. The default created        list is ListType.BULLET, bullet list.       How to create a number list or a image list then?       ListDecorator has powerful functions that can help you. ListDecorator is an interface       which decides how to decorate a list and its list items. We supply 4 implementations of this interface,         BulletDecorator, NumberDecorator, ImageDecorator and OutlineDecorator.
+</div>
+<br/><pre class='code' id="code28">
+<span class='comments'>     // create a number list.</span>
+        <span class='javaclass'>ListDecorator</span> numberDecorator = <span class='modifier'>new</span> <span class='javaclass'>NumberDecorator</span>(document1);<br/>
+        <span class='javaclass'>List</span> numberList1 = document1.addList(numberDecorator);<br/>
+        <span class='javaclass'>List</span> numberList2 = <span class='modifier'>new</span> <span class='javaclass'>List</span>(document1, numberDecorator);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can implement your own ListDecorator as need, or extend the default four implementations.
+</div>
+<div class="bodytext">
+        You can remove a list from the document, the following two methods are same.
+</div>
+<br/><pre class='code' id="code29">
+        list.remove();<br/>
+        document1.removeList(list);<br/>
+</pre>
+<br/><div class="bodytext">
+        We also provide funtions to manipulate list items.      You can use the following methods to get and set the text content of a item.
+</div>
+<br/><pre class='code' id="code30">
+        <span class='javaclass'>String</span> itemContent = item.getTextContent();<br/>
+        item.setTextContent("new item content");<br/>
+</pre>
+<br/><div class="bodytext">
+        You can get the item index and its owner list.
+</div>
+<br/><pre class='code' id="code31">
+        <span class='basic'>int</span> index = item.getIndex();<br/>
+        <span class='javaclass'>List</span> ownerList = item.getOwnerList();<br/>
+</pre>
+<br/><div class="bodytext">
+        When you want to remove an item, besides List.removeItem(ListItem), you can use the following method directly.
+</div>
+<br/><pre class='code' id="code32">
+        item.remove();<br/>
+</pre>
+<br/><div class="bodytext">
+        With the help of the following code, the start number of list item can be set.
+</div>
+<br/><pre class='code' id="code33">
+        item.setStartNumber(3);<br/>
+</pre>
+<br/><div class="bodytext">
+        Since list item is also a ListContainer, you can add sub list to an item.
+</div>
+<br/><pre class='code' id="code34">
+        item.addList();<br/>
+</pre>
+<br/><strong><a href="#Header and Footer" >Header and Footer</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.4.5, we support high level APIs for footer and header.       You can use the following code to get the header and footer. 
+</div>
+<br/><pre class='code' id="code35">
+        <span class='javaclass'>Header</span> docHeader = doc.getHeader();<br/>
+        <span class='javaclass'>Footer</span> footer = doc.getFooter();<br/>
+</pre>
+<br/><div class="bodytext">
+        In order to add contents to header and arrange these contents in a good layout,     I suggest you to use table.     It's easy to add a none-border table to header.     Below codes show how to add a table with 2 columns and 1 row to header, and then        add some text content to the left cell, and add an image to the right cell.
+</div>
+<br/><pre class='code' id="code36">
+        <span class='javaclass'>Table</span> table = docHeader.addTable(1,2);<br/>
+        table.getCellByPosition(0, 0).setStringValue("header table cell");<br/>
+        <span class='javaclass'>Cell</span> cell = table.getCellByPosition(1, 0);<br/>
+        <span class='javaclass'>Image</span> image1 = cell.setImage(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("file:/c:/image.jpg"));<br/>
+</pre>
+<br/><div class="bodytext">
+        Below codes show how to add a table with 1 column and 1 row to footer, and then         add some text content to the cell.      You can easily set the style of these text content. The codes describe how to put       the text content in the center, set the font of the text content,       and set the background of the cell.
+</div>
+<br/><pre class='code' id="code37">
+        table = footer.addTable(1, 1);<br/>
+        <span class='javaclass'>Cell</span> cellByPosition = table.getCellByPosition(0, 0);<br/>
+        cellByPosition.setStringValue("footer table cell");<br/>
+        cellByPosition.setHorizontalAlignment(<span class='javaclass'>HorizontalAlignmentType</span>.<span class='javaclass'>CENTER</span>);<br/>
+        <span class='javaclass'>Font</span> myFont = <span class='modifier'>new</span> <span class='javaclass'>Font</span>("<span class='javaclass'>Arial</span>", <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>FontStyle</span>.<span class='javaclass'>ITALIC</span>, 12, <span class='javaclass'>Color</span>.<span class='javaclass'>BLUE</span>);<br/>
+        cellByPosition.setFont(myFont);<br/>
+        cellByPosition.setCellBackgroundColor(<span class='javaclass'>Color</span>.<span class='javaclass'>YELLOW</span>);<br/>
+</pre>
+<br/><strong><a href="#Text Box" >Text Box</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.5, we support high level APIs for text box.      Below codes will create a text box and add it to the text       document with a paragraph as the anchor position.       The FrameRectangle specifies an area and the position of this text box.
+</div>
+<br/><pre class='code' id="code38">
+        <span class='javaclass'>Paragraph</span> paragraph = doc.getParagraphByIndex(0, <span class='basic'>false</span>);<br/>
+        <span class='javaclass'>Textbox</span> box = paragraph.addTextbox(<span class='modifier'>new</span> <span class='javaclass'>FrameRectangle</span>(1,1,2,1,<span class='javaclass'>SupportedLinearMeasure</span>.<span class='javaclass'>IN</span>));<br/>
+</pre>
+<br/><div class="bodytext">
+        Below codes is to set the text content and name of this text box; 
+</div>
+<br/><pre class='code' id="code39">
+        box.setTextContent("this is a text box");<br/>
+        box.setName("<span class='javaclass'>MyTextbox</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+        Below codes is to get a text box by name or get an iterator of text box contained by a paragraph. 
+</div>
+<br/><pre class='code' id="code40">
+        <span class='javaclass'>Textbox</span> myBox=paragraph.getTextboxByName("<span class='javaclass'>MyTextbox</span>");<br/>
+        <span class='javaclass'>Iterator</span>&lt;<span class='javaclass'>Textbox</span>&gt; boxIter = paragraph.getTextboxIterator();<br/>
+</pre>
+<br/><div class="bodytext">
+        Below code is to set the background color of a text box. 
+</div>
+<br/><pre class='code' id="code41">
+        myBox.setBackgroundColor(<span class='javaclass'>Color</span>.<span class='javaclass'>BLUE</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        Below code is to remove a text box; 
+</div>
+<br/><pre class='code' id="code42">
+        paragraph.removeTextbox(myBox);<br/>
+</pre>
+<br/><strong><a href="#Image" >Image</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.5.5, we support high level APIs for images.      Below codes will create a image and add it to a document with a paragraph as the anchor position.
+</div>
+<br/><pre class='code' id="code43">
+        <span class='javaclass'>Paragraph</span> para = doc.getParagraphByIndex(1, <span class='basic'>false</span>);<br/>
+        <span class='javaclass'>Image</span> image = <span class='javaclass'>Image</span>.newImage(para, <span class='modifier'>new</span> <span class='javaclass'>URI</span>("file:/c:/image.jpg"));<br/>
+</pre>
+<br/><div class="bodytext">
+        Below codes can set the properties of image, and even the vertical (or horizontal) alignment.
+</div>
+<br/><pre class='code' id="code44">
+        image.setTitle("<span class='javaclass'>Image</span> title");<br/>
+        image.setDescription("<span class='javaclass'>This</span> is a sample image");<br/>
+        image.setVerticalPosition(<span class='javaclass'>FrameVerticalPosition</span>.<span class='javaclass'>TOP</span>);<br/>
+        image.setHorizontalPosition(<span class='javaclass'>FrameHorizontalPosition</span>.<span class='javaclass'>RIGHT</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        If you want to add a hyperlink to your image, you can use the following code:
+</div>
+<br/><pre class='code' id="code45">
+        image.setHyperlink(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("http://odftoolkit.org"));<br/>
+</pre>
+<br/><div class="bodytext">
+        If you want to handle more style settings of image, you can try FrameStyleHandler.
+</div>
+<br/><pre class='code' id="code46">
+        <span class='javaclass'>FrameStyleHandler</span> handler = image.getStyleHandler();<br/>
+        handler.setAchorType(<span class='javaclass'>AnchorType</span>.AS_CHARACTER);<br/>
+        handler.setHorizontalRelative(<span class='javaclass'>HorizontalRelative</span>.<span class='javaclass'>PAGE</span>);<br/>
+        handler.setVerticalRelative(<span class='javaclass'>VerticalRelative</span>.<span class='javaclass'>PAGE</span>);<br/>
+</pre>
+<br/><strong><a href="#Span" >Span</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.5.5, we support high level APIs for span.        You can create a span based on a text selection.        With span, you can set a different style to this small unit.
+</div>
+<br/><pre class='code' id="code47">
+        <span class='javaclass'>TextNavigation</span> navigation = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("test", doc);<br/>
+        <span class='javaclass'>TextSelection</span> sel = (<span class='javaclass'>TextSelection</span>) navigation.nextSelection();<br/>
+        <span class='javaclass'>Span</span> span = <span class='javaclass'>Span</span>.newSpan(sel);<br/>
+        <span class='javaclass'>DefaultStyleHandler</span> styleHandler = span.getStyleHandler();<br/>
+        <span class='javaclass'>Font</span> font1Base = <span class='modifier'>new</span> <span class='javaclass'>Font</span>("<span class='javaclass'>Arial</span>", <span class='javaclass'>FontStyle</span>.<span class='javaclass'>ITALIC</span>, 10, <span class='javaclass'>Color</span>.<span class='javaclass'>BLACK</span>, <span class='javaclass'>TextLinePosition</span>.<span class='javaclass'>THROUGH</span>);<br/>
+        styleHandler.getTextPropertiesForWrite().setFont(font1Base);<br/>
+</pre>
+<br/><div class="bodytext">
+The following code is to apply a hyperlink to this span.
+</div>
+<br/><pre class='code' id="code48">
+        span.applyHyperlink(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("ftp://ftpserver"));<br/>
+</pre>
+<br/><strong><a href="#Page Break" >Page Break</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.6.5, we support page break feature.      You can add page break at the end of text document or after a reference paragraph.      It may help you well format your document.
+</div>
+<br/><pre class='code' id="code49">
+        <span class='javaclass'>TextDocument</span> newDoc = <span class='javaclass'>TextDocument</span>.newTextDocument();<br/>
+<span class='comments'>     //add a page break at the end of document.</span>
+        newDoc.addPageBreak();<br/>
+<span class='comments'>     //add a page break at the end of reference paragraph.</span>
+        <span class='javaclass'>Paragraph</span> refParagraph = newDoc.addParagraph("before page break");<br/>
+        newDoc.addPageBreak(refParagraph);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Metadata.html">previous</a></li>
+  <li><a href="Presentation Document.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,86 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="TextExtractor.html">TextExtractor</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate TextSearch.html">previous</a></li>
+  <li><a href="Fields.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Get Text" >Get Text</a></strong>
+<hr/>
+<div class="bodytext">
+        TextExtractor provides a method to get the display text of a single element. EditableTextExtractor is a sub class of TextExtractor.         It provides a method to return all the text that the user can typically edit in a document, including text in cotent.xml,       header and footer in styles.xml, meta data in meta.xml. 
+</div>
+<div class="bodytext">
+        The following codes use EditableTextExtractor as an example, the text of the document "textExtractor.odt" is extracted for user.        For TextExtractor, it can't extract the text from a TextDocument.
+</div>
+<br/><pre class='code' id="code0">
+        <span class='javaclass'>TextDocument</span> textdoc=(<span class='javaclass'>TextDocument</span>)<span class='javaclass'>TextDocument</span>.loadDocument("textExtractor.odt");<br/>
+        <span class='javaclass'>EditableTextExtractor</span> extractorD = <span class='javaclass'>EditableTextExtractor</span>.newOdfEditableTextExtractor(textdoc);<br/>
+        <span class='javaclass'>String</span> output = extractorD.getText();<br/>
+        <span class='javaclass'>System</span>.out.println(output);<br/>
+</pre>
+<br/><div class="bodytext">
+        In the following codes, the whole document content will be returned.        This operation is the same in TextExtractor.
+</div>
+<br/><pre class='code' id="code1">
+        <span class='javaclass'>OdfElement</span> elem=textdoc.getContentRoot();<br/>
+        <span class='javaclass'>EditableTextExtractor</span> extractorE = <span class='javaclass'>EditableTextExtractor</span>.newOdfEditableTextExtractor(elem);<br/>
+        <span class='javaclass'>System</span>.out.println(extractorE.getText());<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate TextSearch.html">previous</a></li>
+  <li><a href="Fields.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">



Mime
View raw message