Simply add the horizontal line to a P and
ENJOY!!
Using java Syntax Highlighting
/**
* Generate a horizontal line
* @return
* @throws JAXBException
*/
public static P generateHorizontalLine() throws JAXBException {
ObjectFactory factory = new ObjectFactory();
P p = factory.createP();
PPr pPr = factory.createPPr();
p.setPPr(pPr);
PPrBase.PBdr bdr = factory.createPPrBasePBdr();
CTBorder bottom = factory.createCTBorder();
pPr.setPBdr(bdr);
bdr.setBottom(bottom);
bottom.setVal( org.docx4j.wml.STBorder.SINGLE );
bottom.setSz( new java.math.BigInteger("6")); //yuck
bottom.setSpace(new java.math.BigInteger("1"));
bottom.setColor("auto");
return p;
}
* Generate a horizontal line
* @return
* @throws JAXBException
*/
public static P generateHorizontalLine() throws JAXBException {
ObjectFactory factory = new ObjectFactory();
P p = factory.createP();
PPr pPr = factory.createPPr();
p.setPPr(pPr);
PPrBase.PBdr bdr = factory.createPPrBasePBdr();
CTBorder bottom = factory.createCTBorder();
pPr.setPBdr(bdr);
bdr.setBottom(bottom);
bottom.setVal( org.docx4j.wml.STBorder.SINGLE );
bottom.setSz( new java.math.BigInteger("6")); //yuck
bottom.setSpace(new java.math.BigInteger("1"));
bottom.setColor("auto");
return p;
}
Parsed in 0.015 seconds, using GeSHi 1.0.8.4
Here is how you can use it: