Package org.docx4j.openpackaging.packages

Examples of org.docx4j.openpackaging.packages.WordprocessingMLPackage.addTargetPart()


    int partsCountBefore = wordMLPackage.getParts().getParts().size();

    // Add it again
    // Note that we're adding this ELSEWHERE in the pkg for the purposes of this test only
    HeaderPart part2 = new HeaderPart()
    Relationship rel = wordMLPackage.addTargetPart(part2, mode);
    if (mode==AddPartBehaviour.REUSE_EXISTING) {
      // In the REUSE_EXISTING case, we won't be adding this part, so
      // we can't add content to it (since its pkg isn't set)
      part2 = (HeaderPart)wordMLPackage.getRelationshipsPart().getPart(rel);
    }
View Full Code Here


    WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
    MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();

    org.docx4j.openpackaging.parts.DocPropsCustomPart docPropsCustomPart = new DocPropsCustomPart();
    wordMLPackage.addTargetPart(docPropsCustomPart);
    org.docx4j.docProps.custom.ObjectFactory cpfactory = new org.docx4j.docProps.custom.ObjectFactory();
    org.docx4j.docProps.custom.Properties customProps = cpfactory.createProperties();
    docPropsCustomPart.setJaxbElement(customProps);
   
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.