public class PageBorderDistanceFrom
Example:
Document doc = new Document();
PageSetup pageSetup = doc.getSections().get(0).getPageSetup();
pageSetup.setBorderAlwaysInFront(false);
pageSetup.setBorderDistanceFrom(PageBorderDistanceFrom.PAGE_EDGE);
pageSetup.setBorderAppliesTo(PageBorderAppliesTo.FIRST_PAGE);
Border border = pageSetup.getBorders().getByBorderType(BorderType.TOP);
border.setLineStyle(LineStyle.SINGLE);
border.setLineWidth(30.0);
border.setColor(Color.BLUE);
border.setDistanceFromText(0.0);
doc.save(getArtifactsDir() + "PageSetup.PageBorderProperties.docx");
Field Summary | ||
---|---|---|
static final int | TEXT | |
Border position is measured from the page margin.
|
||
static final int | PAGE_EDGE | |
Border position is measured from the page edge.
|