Search in sources :

Example 1 with FooterPart

use of org.docx4j.openpackaging.parts.WordprocessingML.FooterPart in project docx4j-template by vindell.

the class Docx4J_例子2 method createFooterPageNumPart.

public Relationship createFooterPageNumPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory, boolean isUnderLine, String underLineSz, JcEnumeration jcEnumeration) throws Exception {
    FooterPart footerPart = new FooterPart();
    footerPart.setPackage(wordprocessingMLPackage);
    footerPart.setJaxbElement(createFooterWithPageNr(wordprocessingMLPackage, factory, isUnderLine, underLineSz, jcEnumeration));
    return t.addTargetPart(footerPart);
}
Also used : FooterPart(org.docx4j.openpackaging.parts.WordprocessingML.FooterPart)

Example 2 with FooterPart

use of org.docx4j.openpackaging.parts.WordprocessingML.FooterPart in project docx4j-template by vindell.

the class Docx4J_简单例子 method createTextFooterPart.

// 文字页脚
public Relationship createTextFooterPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory, String content, JcEnumeration jcEnumeration) throws Exception {
    FooterPart footerPart = new FooterPart();
    Relationship rel = t.addTargetPart(footerPart);
    footerPart.setJaxbElement(getTextFtr(wordprocessingMLPackage, factory, footerPart, content, jcEnumeration));
    return rel;
}
Also used : FooterPart(org.docx4j.openpackaging.parts.WordprocessingML.FooterPart) Relationship(org.docx4j.relationships.Relationship)

Example 3 with FooterPart

use of org.docx4j.openpackaging.parts.WordprocessingML.FooterPart in project docx4j-template by vindell.

the class Docx4J_简单例子 method createFooterPageNumPart.

public Relationship createFooterPageNumPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory) throws Exception {
    FooterPart footerPart = new FooterPart();
    footerPart.setPackage(wordprocessingMLPackage);
    footerPart.setJaxbElement(createFooterWithPageNr(factory));
    return t.addTargetPart(footerPart);
}
Also used : FooterPart(org.docx4j.openpackaging.parts.WordprocessingML.FooterPart)

Example 4 with FooterPart

use of org.docx4j.openpackaging.parts.WordprocessingML.FooterPart in project docx4j-template by vindell.

the class Docx4J_简单例子2 method createTextFooterPart.

// 文字页脚
public Relationship createTextFooterPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory, String content, JcEnumeration jcEnumeration) throws Exception {
    FooterPart footerPart = new FooterPart();
    Relationship rel = t.addTargetPart(footerPart);
    footerPart.setJaxbElement(getTextFtr(wordprocessingMLPackage, factory, footerPart, content, jcEnumeration));
    return rel;
}
Also used : FooterPart(org.docx4j.openpackaging.parts.WordprocessingML.FooterPart) Relationship(org.docx4j.relationships.Relationship)

Example 5 with FooterPart

use of org.docx4j.openpackaging.parts.WordprocessingML.FooterPart in project docx4j-template by vindell.

the class AddingPageNrToFooter method createFooterPart.

/**
 *  As in the previous example, this method creates a footer part and adds it to
 *  the main document and then returns the corresponding relationship.
 *
 *  @return
 *  @throws InvalidFormatException
 */
private static Relationship createFooterPart() throws InvalidFormatException {
    FooterPart footerPart = new FooterPart();
    footerPart.setPackage(wordMLPackage);
    footerPart.setJaxbElement(createFooterWithPageNr());
    return wordMLPackage.getMainDocumentPart().addTargetPart(footerPart);
}
Also used : FooterPart(org.docx4j.openpackaging.parts.WordprocessingML.FooterPart)

Aggregations

FooterPart (org.docx4j.openpackaging.parts.WordprocessingML.FooterPart)13 Relationship (org.docx4j.relationships.Relationship)7 File (java.io.File)1 WordprocessingMLPackage (org.docx4j.openpackaging.packages.WordprocessingMLPackage)1 HeaderPart (org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart)1