Search in sources :

Example 1 with HeaderPart

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

the class Docx4J_简单例子 method createTextHeaderPart.

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

Example 2 with HeaderPart

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

the class Docx4J_简单例子 method createHeaderPart.

// 图片页眉
public Relationship createHeaderPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory) throws Exception {
    HeaderPart headerPart = new HeaderPart();
    Relationship rel = t.addTargetPart(headerPart);
    // After addTargetPart, so image can be added properly
    headerPart.setJaxbElement(getHdr(wordprocessingMLPackage, factory, headerPart));
    return rel;
}
Also used : Relationship(org.docx4j.relationships.Relationship) HeaderPart(org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart)

Example 3 with HeaderPart

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

the class Docx4J_简单例子2 method createHeaderPart.

// 图片页眉
public Relationship createHeaderPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory) throws Exception {
    HeaderPart headerPart = new HeaderPart();
    Relationship rel = t.addTargetPart(headerPart);
    // After addTargetPart, so image can be added properly
    headerPart.setJaxbElement(getHdr(wordprocessingMLPackage, factory, headerPart));
    return rel;
}
Also used : Relationship(org.docx4j.relationships.Relationship) HeaderPart(org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart)

Example 4 with HeaderPart

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

the class Docx4J_简单例子2 method createTextHeaderPart.

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

Example 5 with HeaderPart

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

the class Docx4J_例子2 method createTextHeaderPart.

// 文字页面
public Relationship createTextHeaderPart(WordprocessingMLPackage wordprocessingMLPackage, MainDocumentPart t, ObjectFactory factory, String content, boolean isUnderLine, String underLineSz, JcEnumeration jcEnumeration) throws Exception {
    HeaderPart headerPart = new HeaderPart();
    Relationship rel = t.addTargetPart(headerPart);
    headerPart.setJaxbElement(getTextHdr(wordprocessingMLPackage, factory, headerPart, content, isUnderLine, underLineSz, jcEnumeration));
    return rel;
}
Also used : Relationship(org.docx4j.relationships.Relationship) HeaderPart(org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart)

Aggregations

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