Section
class Section: PDFElement
A PDF section element
-
The columns of the section
Declaration
Swift
let columns: [SectionColumnWidth]
-
The
PDFElement
array that will be drawn into the columnsDeclaration
Swift
let items: [PDFElement]
-
Init the section element
Declaration
Swift
init(columns: [SectionColumnWidth], items: [PDFElement] )
Parameters
columns
The columns of the section
items
The
PDFElement
array that will be drawn into the columns -
Draw the page background color element
Declaration
Swift
func draw(rect: inout CGRect, calculationOnly: Bool, pageRect: CGRect)
Parameters
rect
The available rectangle
calculationOnly
Bool if only the Bounding Rect should be calculated
pageRect
The page size of the PDF document
-
Calculate the width of the columns
Declaration
Swift
private func calculateColumnsWidth(rect: CGRect) -> [CGFloat]
Parameters
rect
The available rectangle
Return Value
An
CGFloat
array with the width for each column -
Calculate the height of the section
Declaration
Swift
private func calculateSectionHeight(rowElements: [PDFElement], columnsWidth: [CGFloat], pageRect: CGRect) -> CGFloat
Parameters
rowElements
The
PDFElement
array in a rowcolumnWidth
The width of the column
Return Value
A
CGFloat
with the calculated height of the section