Examples of WordprocessingMLPackage


Examples of org.docx4j.openpackaging.packages.WordprocessingMLPackage

    noPart(AddPartBehaviour.RENAME_IF_NAME_EXISTS);   
 

  private void noPart(AddPartBehaviour mode) throws Exception {
   
    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
   
    int relsCountBefore = wordMLPackage.getMainDocumentPart().getRelationshipsPart().size();
    int partsCountBefore = wordMLPackage.getParts().getParts().size();
   
    HeaderPart part = new HeaderPart();   
    wordMLPackage.getMainDocumentPart().addTargetPart(part, mode);
   
    // Just added a part
    Assert.assertTrue("hmm", wordMLPackage.getMainDocumentPart().getRelationshipsPart().size()==relsCountBefore+1);
    Assert.assertTrue("hmm", wordMLPackage.getParts().getParts().size()==partsCountBefore+1);   
  }
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.