Package org.docx4j.model.structure
Class PageDimensions
java.lang.Object
org.docx4j.model.structure.PageDimensions
public class PageDimensions
extends java.lang.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 Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlog -
Constructor Summary
Constructors Constructor Description PageDimensions()PageDimensions(SectPr sectPr)PageDimensions(SectPr.PgSz pgSz, SectPr.PgMar pgMar) -
Method Summary
Modifier and Type Method Description SectPr.PgMarcreatePgMar()Deprecated.SectPr.PgSzcreatePgSize()Deprecated.intgetColsNum()intgetColsSpacing()intgetFooterMargin()Get the distance from the bottom edge of the paper to the bottom edge of the footerintgetHeaderMargin()Get the distance from the top edge of the paper to the top edge of the headerSectPr.PgMargetPgMar()SectPr.PgSzgetPgSz()intgetWritableHeightTwips()Deprecated.intgetWritableWidthTwips()voidsetMargins()set Margins from docx4j.propertiesvoidsetMargins(MarginsWellKnown m)voidsetPgMar(SectPr.PgMar pgMar)voidsetPgSize()set page size/orientation from docx4j.propertiesvoidsetPgSize(PageSizePaper sz, boolean landscape)voidsetPgSz(SectPr.PgSz pgSz)
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
PageDimensions
public PageDimensions() -
PageDimensions
- Since:
- 2.7
-
PageDimensions
- Since:
- 2.7
-
-
Method Details
-
getPgSz
- Since:
- 2.7
-
setPgSz
- Since:
- 2.7
-
createPgSize
Deprecated. -
getPgMar
- Since:
- 2.7
-
setPgMar
- Since:
- 2.7
-
createPgMar
Deprecated. -
setMargins
public void setMargins()set Margins from docx4j.properties- Since:
- 2.8
-
setMargins
- Since:
- 2.7
-
setPgSize
public void setPgSize()set page size/orientation from docx4j.properties- Since:
- 2.8
-
setPgSize
- 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()
-