Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Take a look at <a href="http://incubator.apache.org/odftoolkit/odfdom/index.html" rel="nofollow noreferrer">ODFDOM - the OpenDocument API</a></p> <blockquote> <p>ODFDOM is a free OpenDocument Format (ODF) library. Its purpose is to provide an easy common way to create, access and manipulate ODF files, without requiring detailed knowledge of the ODF specification. It is designed to provide the ODF developer community with an easy lightwork programming API portable to any object-oriented language.</p> <p>The current reference implementation is written in Java.</p> </blockquote> <pre><code>// Create a text document from a standard template (empty documents within the JAR) OdfTextDocument odt = OdfTextDocument.newTextDocument(); // Append text to the end of the document. odt.addText("This is my very first ODF test"); // Save document odt.save("MyFilename.odt"); </code></pre> <p><strong><em>later</em></strong></p> <p>As of this writing (2016-02), we are told that these classes are deprecated... big time, and the <code>OdfTextDocument</code> API documentation tells you:</p> <blockquote> <p>As of release 0.8.8, replaced by org.odftoolkit.simple.TextDocument in Simple API.</p> </blockquote> <p>This means you still include the same active .jar file in your project, <code>simple-odf-0.8.1-incubating-jar-with-dependencies.jar</code>, but you want to be unpacking the following .jar to get the documentation: <code>simple-odf-0.8.1-incubating-javadoc.jar</code>, rather than <code>odfdom-java-0.8.10-incubating-javadoc.jar</code>.</p> <p>Incidentally, the documentation link downloads a bunch of jar files inside a .zip which says "0.6.1"... but most of the stuff inside appears to be more like 0.8.1. I have no idea why they say "as of 0.8.8" in the documentation for the "deprecated" classes: just about everything is already marked deprecated.</p> <p>The equivalent simple code to the above is then:</p> <pre><code>odt_doc = org.odftoolkit.simple.TextDocument.newTextDocument() para = odt_doc.getParagraphByIndex( 0, False ) para.appendTextContent( 'stuff and nonsense' ) odt_doc.save( 'mySpankingNewFile.odt' ) </code></pre> <p>PS am using Jython, but the Java should be obvious.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload