public class Document
extends Element
Represents a pdf document. The document is the outer container for all elements belonging to a pdf. Once rendered, it cannot be modified.
Element.Companion
Constructor and Description |
---|
Document()
Represents a pdf document. The document is the outer container for all
elements belonging to a pdf. Once rendered, it cannot be modified.
|
Modifier and Type | Method and Description |
---|---|
float |
adjustStartYForPaging(float startY,
float endY)
If startY and endY cross a page (or page margin) boundary, returns a new startY for rendering. Otherwise
returns the original startY.
|
java.util.List<com.github.timrs2998.pdfbuilder.Element> |
getChildren() |
kotlin.jvm.functions.Function2<java.lang.Integer,java.lang.Integer,com.github.timrs2998.pdfbuilder.Element> |
getFooterFactory() |
Orientation |
getOrientation() |
float |
getPageHeight() |
float |
getPageWidth() |
org.apache.pdfbox.pdmodel.common.PDRectangle |
getPdRectangle() |
float |
instanceHeight(float width,
float startY)
Determines the innermost height of the element, excluding margins and padding.
|
org.apache.pdfbox.pdmodel.PDDocument |
render()
Forces one-time evaluation of lazy properties and renders object model to
a PDDocument. Once called, document can no longer be modified.
|
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 |
setFooterFactory(kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,? extends com.github.timrs2998.pdfbuilder.Element> p) |
void |
setOrientation(Orientation p) |
getBackgroundColor, getBorder, getDocument, getFontColor, getFontSize, getHorizontalAlignment, getMargin, getPadding, getParent, getPdFont, height, instanceHeight, render, renderInstance, setBackgroundColor, setBorder, setFontColor, setFontSize, setHorizontalAlignment, setMargin, setPadding, setPdFont
public Document()
Represents a pdf document. The document is the outer container for all elements belonging to a pdf. Once rendered, it cannot be modified.
public java.util.List<com.github.timrs2998.pdfbuilder.Element> getChildren()
public kotlin.jvm.functions.Function2<java.lang.Integer,java.lang.Integer,com.github.timrs2998.pdfbuilder.Element> getFooterFactory()
public void setFooterFactory(kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,? extends com.github.timrs2998.pdfbuilder.Element> p)
public Orientation getOrientation()
public void setOrientation(Orientation p)
public org.apache.pdfbox.pdmodel.common.PDRectangle getPdRectangle()
public float getPageWidth()
public float getPageHeight()
public float instanceHeight(float width, float startY)
Determines the innermost height of the element, excluding margins and padding.
public org.apache.pdfbox.pdmodel.PDDocument render()
Forces one-time evaluation of lazy properties and renders object model to a PDDocument. Once called, document can no longer be modified.
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 float adjustStartYForPaging(float startY, float endY)
If startY and endY cross a page (or page margin) boundary, returns a new startY for rendering. Otherwise returns the original startY.
TODO: also consider padding