Package org.odftoolkit.simple

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


  @Test
  public void testReturnChar() {
    try {
      TextDocument textDoc = TextDocument.newTextDocument();
      textDoc.newParagraph();
      OdfTextParagraph graph = textDoc.newParagraph("abc");

      TextExtractor extractor = TextExtractor.newOdfTextExtractor(textDoc.getContentRoot());
      String text = extractor.getText();
      System.out.println(text);
View Full Code Here


  @Test
  public void testReturnChar() {
    try {
      TextDocument textDoc = TextDocument.newTextDocument();
      textDoc.newParagraph();
      OdfTextParagraph graph = textDoc.newParagraph("abc");

      TextExtractor extractor = TextExtractor.newOdfTextExtractor(textDoc.getContentRoot());
      String text = extractor.getText();
      System.out.println(text);
View Full Code Here

    try {
      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT));
      // declare simple variable
      VariableField simpleVariableField = Fields.createSimpleVariableField(doc, "test_simple_variable");
      Assert.assertNotNull(simpleVariableField);
      TextSpanElement newTextSpanElement = doc.newParagraph("Update Simple Variable Field:").newTextSpanElement();
      simpleVariableField.updateField("simple variable content", newTextSpanElement);
     
      FieldType fieldType = simpleVariableField.getFieldType();
      Assert.assertNotNull(fieldType);
      Assert.assertEquals(FieldType.SIMPLE_VARIABLE_FIELD, fieldType);
View Full Code Here

      int count = 0;
      while (sections.hasNext()) {
        Section aSection = sections.next();
        count++;
        doc.newParagraph("----Start of " + aSection.getName() + "---------");
        doc.appendSection(aSection, false);
        doc.newParagraph("----End of " + aSection.getName() + "---------");
        doc.newParagraph();
        doc.newParagraph();
        doc.newParagraph();
View Full Code Here

      while (sections.hasNext()) {
        Section aSection = sections.next();
        count++;
        doc.newParagraph("----Start of " + aSection.getName() + "---------");
        doc.appendSection(aSection, false);
        doc.newParagraph("----End of " + aSection.getName() + "---------");
        doc.newParagraph();
        doc.newParagraph();
        doc.newParagraph();
      }
      doc.save(ResourceUtilities.newTestOutputFile("NewSections.odt"));
View Full Code Here

        Section aSection = sections.next();
        count++;
        doc.newParagraph("----Start of " + aSection.getName() + "---------");
        doc.appendSection(aSection, false);
        doc.newParagraph("----End of " + aSection.getName() + "---------");
        doc.newParagraph();
        doc.newParagraph();
        doc.newParagraph();
      }
      doc.save(ResourceUtilities.newTestOutputFile("NewSections.odt"));
View Full Code Here

        count++;
        doc.newParagraph("----Start of " + aSection.getName() + "---------");
        doc.appendSection(aSection, false);
        doc.newParagraph("----End of " + aSection.getName() + "---------");
        doc.newParagraph();
        doc.newParagraph();
        doc.newParagraph();
      }
      doc.save(ResourceUtilities.newTestOutputFile("NewSections.odt"));

      doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("NewSections.odt"));
View Full Code Here

        doc.newParagraph("----Start of " + aSection.getName() + "---------");
        doc.appendSection(aSection, false);
        doc.newParagraph("----End of " + aSection.getName() + "---------");
        doc.newParagraph();
        doc.newParagraph();
        doc.newParagraph();
      }
      doc.save(ResourceUtilities.newTestOutputFile("NewSections.odt"));

      doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("NewSections.odt"));
      sections = doc.getSectionIterator();
View Full Code Here

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

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

    try {
      TextDocument document = TextDocument.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

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.