Package org.odftoolkit.simple

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


      TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("headerFooterHidden.odt"));
      Footer footer = doc.getFooter();
      Assert.assertEquals(true, footer.isVisible());
      footer.setVisible(false);
      Assert.assertEquals(false, footer.isVisible());
      doc.save(ResourceUtilities.newTestOutputFile("footerHiddenOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(FooterTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here


      Assert.assertNotNull(tab);
      Assert.assertTrue(2 == tab.getRowCount());
      Assert.assertTrue(5 == tab.getColumnCount());
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("footerOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(FooterTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

     
      Node nod = odfEle.getFirstChild();
      Assert.assertEquals("table:table", nod.getNodeName());
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("footerOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(FooterTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      NamedNodeMap nameMap = nod.getAttributes();
      Node nodtext = nameMap.getNamedItem("text:name");
      Assert.assertEquals("footername", nodtext.getNodeValue());
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("footerOutput.odt"));
    } catch (Exception e) {
      Logger.getLogger(FooterTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      Assert.assertEquals(t1, paragraph2);
      t1 = doc.getParagraphByReverseIndex(2, false);
      Assert.assertEquals(t1, paragraph1);
      t1 = doc.getParagraphByReverseIndex(1, true);
      Assert.assertEquals(t1, paragraph1);
      doc.save(ResourceUtilities.newTestOutputFile("testGetParagraphByIndex.odt"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      LOGGER.info(font3.toString());
      Font font33 = paragraph3.getFont();
      if (!font33.equals(font3)) {
        Assert.fail();
      }
      doc.save(ResourceUtilities.newTestOutputFile("TestParagraphSetGetFont.odt"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail();
    }
  }
View Full Code Here

      paragraph1.setHorizontalAlignment(HorizontalAlignmentType.RIGHT);
      align = paragraph1.getHorizontalAlignment();
      Assert.assertEquals(HorizontalAlignmentType.RIGHT, align);

      doc.save(ResourceUtilities.newTestOutputFile("TestParagraphSetGetHoriAlignment.odt"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail();
    }
  }
View Full Code Here

      Assert.assertEquals(1, textParagraph.getHeadingLevel());
      textParagraph.applyHeading(true, 3);
      Assert.assertEquals(true, textParagraph.isHeading());
      Assert.assertEquals(3, textParagraph.getHeadingLevel());

      doc.save(ResourceUtilities.newTestOutputFile("TestParagraphSetGetHeading.odt"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail();
    }
  }
View Full Code Here

      TextHyperlink link3 = para3.applyHyperlink(new URI("http://odftoolkit.org"));
      link3.setTextContent("new world");
      para3.appendTextContent("_prefix");
      para3.appendTextContent("_nolink", false);

      doc.save(ResourceUtilities.newTestOutputFile("TestParagraphHyperlink.odt"));

      TextDocument textdoc = TextDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream("TestParagraphHyperlink.odt"));
      Iterator<TextHyperlink> linkList = textdoc.getParagraphByReverseIndex(1, true).getHyperlinkIterator();
      if (linkList.hasNext()) {
View Full Code Here

      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);
      Assert.fail(e.getMessage());
    }
  }
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.