Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.TextDocument.addParagraph()


   */
  @Test
  public void testReplacewithImage() throws Exception {
    // create source image
    TextDocument sourcedoc = TextDocument.newTextDocument();
    Paragraph para = sourcedoc.addParagraph("helloImage");
    Image image = Image.newImage(para, ResourceUtilities.getURI("image_list_item.png"));
    image.setName("this image 1");
    image.setHyperlink(new URI("http://odftoolkit.org"));
    Paragraph para2 = sourcedoc.addParagraph("helloImage2");
    Image image2 = Image.newImage(para2, ResourceUtilities.getURI("testA.jpg"));
View Full Code Here


      textDocument.addParagraph("Third table");
      table = Table.newTable(textDocument, 1, 12);
      columnsWidth = new long[] { 5, 8, 10, 11, 7, 7, 26, 12, 19, 19, 41, 3 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("fourth table (left space of 15mm and 10mm space right)");
      table = Table.newTable(textDocument, 1, 12, 1.5, 1.0);
      columnsWidth = new long[] { 5, 8, 10, 11, 7, 7, 11, 12, 9, 19, -1, 3 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("fifth table (space of -1 cm to the left and right space of -1.5cm)");
View Full Code Here

    TextDocument sourcedoc = TextDocument.newTextDocument();
    Paragraph para = sourcedoc.addParagraph("helloImage");
    Image image = Image.newImage(para, ResourceUtilities.getURI("image_list_item.png"));
    image.setName("this image 1");
    image.setHyperlink(new URI("http://odftoolkit.org"));
    Paragraph para2 = sourcedoc.addParagraph("helloImage2");
    Image image2 = Image.newImage(para2, ResourceUtilities.getURI("testA.jpg"));
    image2.setName("this image 2");
    image2.setHyperlink(new URI("http://odftoolkit.org"));
    search = null;
    // 6 Simple, at the middle of original Paragraph, split original
View Full Code Here

      textDocument.addParagraph("fourth table (left space of 15mm and 10mm space right)");
      table = Table.newTable(textDocument, 1, 12, 1.5, 1.0);
      columnsWidth = new long[] { 5, 8, 10, 11, 7, 7, 11, 12, 9, 19, -1, 3 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("fifth table (space of -1 cm to the left and right space of -1.5cm)");
      table = Table.newTable(textDocument, 1, 10, -1, -1.5);
      columnsWidth = new long[] { 32, 8, 10, 11, 7, 7, 16, 12, -1, 18 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("sixth table (merging of columns 3-4, row 0, and other merging)");
View Full Code Here

      textDocument.addParagraph("fifth table (space of -1 cm to the left and right space of -1.5cm)");
      table = Table.newTable(textDocument, 1, 10, -1, -1.5);
      columnsWidth = new long[] { 32, 8, 10, 11, 7, 7, 16, 12, -1, 18 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("sixth table (merging of columns 3-4, row 0, and other merging)");
      table = Table.newTable(textDocument, 2, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);
      CellRange vCellRange = table.getCellRangeByPosition(3, 0, 4, 0);
      vCellRange.merge();
View Full Code Here

    try {
      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT));

      // declare simple variable
      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable");
      Paragraph varParagraph = doc.addParagraph("test_con_variable:");
      simpleVariableField.updateField("true", varParagraph.getOdfElement());

      // test condition field
      Paragraph newParagraph = doc.addParagraph("Condition Field Test:");
      ConditionField conditionField = Fields.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",
View Full Code Here

      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable");
      Paragraph varParagraph = doc.addParagraph("test_con_variable:");
      simpleVariableField.updateField("true", varParagraph.getOdfElement());

      // test condition field
      Paragraph newParagraph = doc.addParagraph("Condition Field Test:");
      ConditionField conditionField = Fields.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",
          "trueText", "falseText");
      Assert.assertNotNull(conditionField);
      conditionField.updateTrueText("trueTextUpdate");
     
View Full Code Here

      vCellRange.merge();
      table.appendRows(2);
      vCellRange = table.getCellRangeByPosition(4, 1, 5, 2);
      vCellRange.merge();

      textDocument.addParagraph("as above, but no merging");
      table = Table.newTable(textDocument, 1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("table with three columns width at 0");
View Full Code Here

      textDocument.addParagraph("as above, but no merging");
      table = Table.newTable(textDocument, 1, 8);
      columnsWidth = new long[] { 5, 19, 11, 14, 27, 12, 75, 4 };
      setColumnsWidth(table, columnsWidth);

      textDocument.addParagraph("table with three columns width at 0");
      table = Table.newTable(textDocument, 1, 12);
      columnsWidth = new long[] { 0, 13, 10, 11, 0, 14, 26, 12, 19, 19, 47, 0 };
      setColumnsWidth(table, columnsWidth);

      table = Table.newTable(textDocument, 1, 3);
View Full Code Here

    try {
      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT));

      // declare simple variable
      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_con_variable");
      Paragraph varParagraph = doc.addParagraph("test_con_variable:");
      simpleVariableField.updateField("true", varParagraph.getOdfElement());

      // test condition field
      Paragraph newParagraph = doc.addParagraph("Condition Field Test:");
      ConditionField conditionField = Fields.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",
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.