'I want to change the color, size and style of the font in footer Apache poi XWPF
I want to change the color, size and style of the font in footer Apache poi XWPF
FileInputStream finStream = new FileInputStream(pathToWorkbook);
XWPFDocument docx = new XWPFDocument(finStream);
docx
.createFooter(HeaderFooterType.DEFAULT)
.createParagraph()
.createRun()
.setText("FOOTER");
or
XWPFParagraph[] pars;
CTP ctP = CTP.Factory.newInstance();
CTText t = ctP.addNewR().addNewT();
pars = new XWPFParagraph[1];
XWPFHeaderFooterPolicy hfPolicy = doc.createHeaderFooterPolicy();
ctP = CTP.Factory.newInstance();
t = ctP.addNewR().addNewT();
// footer text
t.setStringValue("Sample Footer Text");
pars[0] = new XWPFParagraph(ctP, doc);
hfPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT, pars);
Please help, if you can :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
