I want to include a footer into a Word Office 2007 document.
I'm capable to create the footer.xml e make the relationship. But the footer is not showed in Word !!
Document footer = DocumentHelper.createDocument();
Namespace name = getNamespaceWordProcessingML();
Element elFtr = footer.addElement(new QName("ftr",name));
Element elParagraph = elFtr.addElement(new QName("p",name));
Element elPpr = elParagraph.addElement(new QName("pPr",name));
Element elPStyle = elPpr.addElement(new QName("pStyle",name));
elPStyle.setAttributeValue(new QName("val",name), "Rodap");
Element elRun = elParagraph.addElement(new QName("r",name));
Element elText = elRun.addElement(new QName("t",name));
elText.setText("This is a footer !!");
I want to include a footer into a Word Office 2007 document.
I'm capable to create the footer.xml e make the relationship. But the footer is not showed in Word !!
I do the following stpes:
PackagePartName footerPartName = PackagingURIHelper.createPartName("/word/footer1.xml");
PackagePart footerPart = packate.createPart(footerPartName,
"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml");
getCoreDocumentPart().addRelationship(footerPartName,TargetMode.INTERNAL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", "rIdFooter");
Document footer = DocumentHelper.createDocument();
Namespace name = getNamespaceWordProcessingML();
Element elFtr = footer.addElement(new QName("ftr",name));
Element elParagraph = elFtr.addElement(new QName("p",name));
Element elPpr = elParagraph.addElement(new QName("pPr",name));
Element elPStyle = elPpr.addElement(new QName("pStyle",name));
elPStyle.setAttributeValue(new QName("val",name), "Rodap");
Element elRun = elParagraph.addElement(new QName("r",name));
Element elText = elRun.addElement(new QName("t",name));
elText.setText("This is a footer !!");
StreamHelper.saveXmlInStream(footer, footerPart.getOutputStream());
package.save(baos);
Can someone help me ??