I am trying to add images inside header and footer. I just copy and pasted docx4j sample from:
http://dev.plutext.org/trac/docx4j/brow ... ooter.java
After running I am getting this exception:
- Code: Select all
log4j:WARN No appenders could be found for logger (org.docx4j.openpackaging.parts.PartName).
log4j:WARN Please initialize the log4j system properly.
JAXB: RI not present. Trying Java 6 implementation.
JAXB: Using Java 6 implementation.
Exception in thread "main" java.lang.NullPointerException
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.createImagePart(BinaryPartAbstractImage.java:190)
at test.HeaderFooter.newImage(HeaderFooter.java:130)
at test.HeaderFooter.getHdr(HeaderFooter.java:76)
at test.HeaderFooter.createHeaderPart(HeaderFooter.java:65)
at test.HeaderFooter.main(HeaderFooter.java:44)
I am using docx4j-2.5.0.jar and windows seven.
By the way, I am able to add header and footers without images without problem. The problem is when I am sending my header part to BinaryPartAbstractImage.createImagePart as it is said in your sample.
Any ideas what am I missing?
Thanks in advance for your time and consideration.