com.aspose.words

Class PageBorderDistanceFrom

  • java.lang.Object
    • com.aspose.words.PageBorderDistanceFrom
public class PageBorderDistanceFrom 
extends java.lang.Object

Utility class containing constants. Specifies the positioning of the page border relative to the page margin.

Example:

Creates a page border that looks like a wide blue band at the top of the first page only.
Document doc = new Document();

PageSetup ps = doc.getSections().get(0).getPageSetup();
ps.setBorderAlwaysInFront(false);
ps.setBorderDistanceFrom(PageBorderDistanceFrom.PAGE_EDGE);
ps.setBorderAppliesTo(PageBorderAppliesTo.FIRST_PAGE);

Border border = ps.getBorders().getByBorderType(BorderType.TOP);
border.setLineStyle(LineStyle.SINGLE);
border.setLineWidth(30);
border.setColor(Color.BLUE);
border.setDistanceFromText(0);

doc.save(getMyDir() + "\\Artifacts\\PageSetup.PageBorderTop.doc");
See Also:
PageSetup, PageSetup.BorderDistanceFrom

Field Summary
static final intTEXT = 0
Border position is measured from the page margin.
static final intPAGE_EDGE = 1
Border position is measured from the page edge.
 

    • Field Detail

      • TEXT = 0

        public static final int TEXT
        Border position is measured from the page margin.
      • PAGE_EDGE = 1

        public static final int PAGE_EDGE
        Border position is measured from the page edge.