Package org.odftoolkit.odfdom.doc

Examples of org.odftoolkit.odfdom.doc.OdfDocument.save()


      String packagePath = embeddedDoc.getDocumentPath() + SLASH + OdfPackage.OdfFile.IMAGE_DIRECTORY.getPath() + SLASH + TEST_PIC;
      OdfFileEntry imageEntry = embeddedDoc.getPackage().getFileEntry(packagePath);
      Assert.assertNotNull(imageEntry);
      embeddedDoc.newImage(ResourceUtilities.getURI(TEST_PIC_ANOTHER));
      //save the "DocA" as the standalone document
      embeddedDoc.save(TEST_FILE_FOLDER + TEST_FILE_MODIFIED_EMBEDDED_SAVE_STANDALONE);
      //load the standalone document and check the content
      OdfDocument standaloneDoc = OdfDocument.loadDocument(ResourceUtilities.getAbsolutePath(TEST_FILE_MODIFIED_EMBEDDED_SAVE_STANDALONE));
      embedContentDom = standaloneDoc.getContentDom();
      header = (TextHElement) xpath.evaluate("//text:h[1]", embedContentDom, XPathConstants.NODE);
      Assert.assertTrue(header.getTextContent().length() == 0);
View Full Code Here


      // ToDo: Should be added as test when header/footer styles are supported in ODFDOM
//      HashMap<String, String> pageProps1 = getPageStyleProps(odfDoc, masterPage1);
//      HashMap<String, String> footerProps1 = getFooterStyleProps(odfDoc, masterPage1);
//      HashMap<String, String> headerProps1 = getHeaderStyleProps(odfDoc, masterPage1);

      odfDoc.save(ResourceUtilities.newTestOutputFile("TestHeaderFooter.odt"));
      odfDoc = OdfDocument.loadDocument(ResourceUtilities.getAbsolutePath("TestHeaderFooter.odt"));
      Map<String, StyleMasterPageElement> masterPages2 = odfDoc.getMasterPages();
      StyleMasterPageElement masterPage2 = masterPages2.get("Standard");

        // Test if the new footer exists
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.