Package org.docx4j.samples
Class HeaderFooterCreate
java.lang.Object
org.docx4j.samples.HeaderFooterCreate
Create a WordML Pkg and add a header to it.
Output is Flat OPC XML.
Notice:
1. the Header part
2. the contents of the sectPr element
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RelationshipcreateHeaderPart(WordprocessingMLPackage wordprocessingMLPackage) static voidcreateHeaderReference(WordprocessingMLPackage wordprocessingMLPackage, Relationship relationship) static HdrgetHdr(WordprocessingMLPackage wordprocessingMLPackage, Part sourcePart) static voidstatic PnewImage(WordprocessingMLPackage wordMLPackage, Part sourcePart, byte[] bytes, String filenameHint, String altText, int id1, int id2)
-
Field Details
-
objectFactory
-
-
Constructor Details
-
HeaderFooterCreate
public HeaderFooterCreate()
-
-
Method Details
-
main
- Throws:
Exception
-
createHeaderPart
public static Relationship createHeaderPart(WordprocessingMLPackage wordprocessingMLPackage) throws Exception - Throws:
Exception
-
createHeaderReference
public static void createHeaderReference(WordprocessingMLPackage wordprocessingMLPackage, Relationship relationship) throws InvalidFormatException - Throws:
InvalidFormatException
-
getHdr
public static Hdr getHdr(WordprocessingMLPackage wordprocessingMLPackage, Part sourcePart) throws Exception - Throws:
Exception
-
newImage
public static P newImage(WordprocessingMLPackage wordMLPackage, Part sourcePart, byte[] bytes, String filenameHint, String altText, int id1, int id2) throws Exception - Throws:
Exception
-