Package org.odftoolkit.odfdom.doc

Examples of org.odftoolkit.odfdom.doc.OdfTextDocument.addText()


    // 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");
  }
View Full Code Here


    // Load Image
    odt = (OdfTextDocument) OdfDocument.loadDocument("ImageIn.odt");

    // Play around with text
    odt.addText("When there is no paragraph, the text will be embedded in a new paragraph");
    odt.newParagraph("Create new paragraph");
    odt.addText("\nThis is a new line");

    // Insert Image and make last paragraph its anchor
    odt.newImage(new URI("./MySampleImage.png"));
View Full Code Here

    odt = (OdfTextDocument) OdfDocument.loadDocument("ImageIn.odt");

    // Play around with text
    odt.addText("When there is no paragraph, the text will be embedded in a new paragraph");
    odt.newParagraph("Create new paragraph");
    odt.addText("\nThis is a new line");

    // Insert Image and make last paragraph its anchor
    odt.newImage(new URI("./MySampleImage.png"));

    // Insert new spreadsheet as sub document into the package within directory  "myOdsDirectoryPath/"
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.