Package org.odftoolkit.odfdom.doc

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


    // 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


  @Test
  public void testNewTable() {
    try {
      OdfTextDocument document = OdfTextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      createEmptyTable(document);

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
View Full Code Here

    try {
      OdfTextDocument document = OdfTextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      createEmptyTable(document);

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);
View Full Code Here

      OdfTextDocument document = OdfTextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      createEmptyTable(document);

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);
View Full Code Here

      createEmptyTable(document);

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);

      document.save(ResourceUtilities.newTestOutputFile("CreateTableCase.odt"));
    } catch (Exception e) {
View Full Code Here

      document.newParagraph();
      document.newParagraph("Table with float values:");
      createTableWithData(document);
      document.newParagraph();
      document.newParagraph("Table with string values:");
      createTableWithString(document);

      document.save(ResourceUtilities.newTestOutputFile("CreateTableCase.odt"));
    } catch (Exception e) {
      Logger.getLogger(TableTest.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

  @Test
  public void testSetGetWidth() {
    long width = 500;
    try {
      OdfTextDocument document = OdfTextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      OdfTable table = createEmptyTable(document);
      table.setWidth(width);
      Assert.assertTrue(Math.abs(width - table.getWidth()) < 3);

      document.save(ResourceUtilities.newTestOutputFile("TestSetGetWidth.odt"));
View Full Code Here

  public void testGetSetTablename() {
    String tablename = "My Table";
    OdfTextDocument document = null;
    try {
      document = OdfTextDocument.newTextDocument();
      document.newParagraph("Empty table:");
      OdfTable table = createEmptyTable(document);
      table.setTableName(tablename);
      Assert.assertEquals(tablename, table.getTableName());

      document.save(ResourceUtilities.newTestOutputFile("TestGetSetName.odt"));
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.