Class PageDimensions

java.lang.Object
org.docx4j.model.structure.PageDimensions

public class PageDimensions extends Object
Wraps PgSz (Page size) and PgMar (margin settings). - gives you an easy way to set these; - performs a few useful calculations Used in SectionWrapper, to store the dimensions of a page for a section; can also be used to store a set of page dimensions which aren't associated with any section.
Author:
jharrop
  • Field Details

    • log

      protected static org.slf4j.Logger log
  • Constructor Details

    • PageDimensions

      public PageDimensions()
    • PageDimensions

      public PageDimensions(SectPr.PgSz pgSz, SectPr.PgMar pgMar)
      Since:
      2.7
    • PageDimensions

      public PageDimensions(SectPr sectPr)
      Since:
      2.7
  • Method Details

    • getPgSz

      public SectPr.PgSz getPgSz()
      Since:
      2.7
    • setPgSz

      public void setPgSz(SectPr.PgSz pgSz)
      Since:
      2.7
    • createPgSize

      @Deprecated public SectPr.PgSz createPgSize()
      Deprecated.
    • getPgMar

      public SectPr.PgMar getPgMar()
      Since:
      2.7
    • setPgMar

      public void setPgMar(SectPr.PgMar pgMar)
      Since:
      2.7
    • createPgMar

      @Deprecated public SectPr.PgMar createPgMar()
      Deprecated.
    • setMargins

      public void setMargins()
      set Margins from docx4j.properties
      Since:
      2.8
    • setMargins

      public void setMargins(MarginsWellKnown m)
      Since:
      2.7
    • setPgSize

      public void setPgSize()
      set page size/orientation from docx4j.properties
      Since:
      2.8
    • setPgSize

      public void setPgSize(PageSizePaper sz, boolean landscape)
      Since:
      2.7
    • getWritableWidthTwips

      public int getWritableWidthTwips()
    • getWritableHeightTwips

      @Deprecated public int getWritableHeightTwips()
      Deprecated.
      headers/footers into account! Doesn't take
      Since:
      3.0.1
    • getHeaderMargin

      public int getHeaderMargin()
      Get the distance from the top edge of the paper to the top edge of the header
    • getFooterMargin

      public int getFooterMargin()
      Get the distance from the bottom edge of the paper to the bottom edge of the footer
    • getColsNum

      public int getColsNum()
    • getColsSpacing

      public int getColsSpacing()