public class Element
Everything belonging to a class Document
extends from class Element
, including
class Document
itself. An class Element
knows its Element.height
and how
to Element.render
itself.
Unless overridden, the default implementations of Element.render
and Element.height
assume that the class Element
will not span multiple pages and must fit
on a single page. The class TableElement
is an example of an class Element
that overrides these methods to span multiple pages.
An class Element
can be styled similar to CSS, being assigned a Element.getBorder
,
Element.getMargin
, Element.getPadding
, Element.getBackgroundColor
, Element.getFontColor
, Element.getFontSize
,
Element.getHorizontalAlignment
, and Element.getPdFont
.
Most styles will "cascade" or be inherited by children. The only styles
that are not inherited are Element.getBorder
, Element.getMargin
, and Element.getPadding
.
class Document
,
class Element
,
class Document
,
class Element
,
Element.height
,
Element.render
,
Element.render
,
Element.height
,
class Element
,
class TableElement
,
class Element
,
class Element
,
Element.getBorder
,
Element.getMargin
,
Element.getPadding
,
Element.getBackgroundColor
,
Element.getFontColor
,
Element.getFontSize
,
Element.getHorizontalAlignment
,
Element.getPdFont
,
Element.getBorder
,
Element.getMargin
,
Element.getPadding
Modifier and Type | Class and Description |
---|---|
static class |
Element.Companion |
Modifier and Type | Field and Description |
---|---|
static Element.Companion |
Companion |
Constructor and Description |
---|
Element(Element parent)
Everything belonging to a
class Document extends from class Element , including
class Document itself. An class Element knows its Element.height and how
to Element.render itself. |
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBackgroundColor() |
Border |
getBorder() |
Document |
getDocument() |
java.awt.Color |
getFontColor() |
java.lang.Float |
getFontSize() |
Alignment |
getHorizontalAlignment() |
Margin |
getMargin() |
Padding |
getPadding() |
Element |
getParent() |
org.apache.pdfbox.pdmodel.font.PDFont |
getPdFont() |
float |
height(float width,
float startY,
float minHeight)
Determines the height considered by this element, including margins and padding.
|
float |
instanceHeight(float width,
float startY)
Determines the innermost height of the element, excluding margins and padding.
|
void |
render(org.apache.pdfbox.pdmodel.PDDocument pdDocument,
float startX,
float endX,
float startY,
float minHeight)
Renders the entire element including margins, padding, borders, and background. Unless
overridden, assumes the element being rendered will fit on the page. Multi-page elements
(ie:
class TableElement ) must handle paging themselves. |
void |
renderInstance(org.apache.pdfbox.pdmodel.PDDocument pdDocument,
float startX,
float endX,
float startY,
float minHeight)
Renders the innermost element, excluding margins, padding, borders, and background.
|
void |
setBackgroundColor(java.awt.Color p) |
void |
setBorder(Border p) |
void |
setFontColor(java.awt.Color p) |
void |
setFontSize(java.lang.Float p) |
void |
setHorizontalAlignment(Alignment p) |
void |
setMargin(Margin p) |
void |
setPadding(Padding p) |
void |
setPdFont(org.apache.pdfbox.pdmodel.font.PDFont p) |
public static Element.Companion Companion
public Element(Element parent)
Everything belonging to a class Document
extends from class Element
, including
class Document
itself. An class Element
knows its Element.height
and how
to Element.render
itself.
Unless overridden, the default implementations of Element.render
and Element.height
assume that the class Element
will not span multiple pages and must fit
on a single page. The class TableElement
is an example of an class Element
that overrides these methods to span multiple pages.
An class Element
can be styled similar to CSS, being assigned a Element.getBorder
,
Element.getMargin
, Element.getPadding
, Element.getBackgroundColor
, Element.getFontColor
, Element.getFontSize
,
Element.getHorizontalAlignment
, and Element.getPdFont
.
Most styles will "cascade" or be inherited by children. The only styles
that are not inherited are Element.getBorder
, Element.getMargin
, and Element.getPadding
.
class Document
,
class Element
,
class Document
,
class Element
,
Element.height
,
Element.render
,
Element.render
,
Element.height
,
class Element
,
class TableElement
,
class Element
,
class Element
,
Element.getBorder
,
Element.getMargin
,
Element.getPadding
,
Element.getBackgroundColor
,
Element.getFontColor
,
Element.getFontSize
,
Element.getHorizontalAlignment
,
Element.getPdFont
,
Element.getBorder
,
Element.getMargin
,
Element.getPadding
public Border getBorder()
public void setBorder(Border p)
public Margin getMargin()
public void setMargin(Margin p)
public Padding getPadding()
public void setPadding(Padding p)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color p)
public java.awt.Color getFontColor()
public void setFontColor(java.awt.Color p)
public java.lang.Float getFontSize()
public void setFontSize(java.lang.Float p)
public Alignment getHorizontalAlignment()
public void setHorizontalAlignment(Alignment p)
public org.apache.pdfbox.pdmodel.font.PDFont getPdFont()
public void setPdFont(org.apache.pdfbox.pdmodel.font.PDFont p)
public Document getDocument()
public float height(float width, float startY, float minHeight)
Determines the height considered by this element, including margins and padding.
public float instanceHeight(float width, float startY)
Determines the innermost height of the element, excluding margins and padding.
public void render(org.apache.pdfbox.pdmodel.PDDocument pdDocument, float startX, float endX, float startY, float minHeight)
Renders the entire element including margins, padding, borders, and background. Unless
overridden, assumes the element being rendered will fit on the page. Multi-page elements
(ie: class TableElement
) must handle paging themselves.
class TableElement
public void renderInstance(org.apache.pdfbox.pdmodel.PDDocument pdDocument, float startX, float endX, float startY, float minHeight)
Renders the innermost element, excluding margins, padding, borders, and background.
public Element getParent()