Section
class Section: PDFElement
A PDF section element
-
The columns of the section
Declaration
Swift
let columns: [SectionColumnWidth] -
The
PDFElementarray that will be drawn into the columnsDeclaration
Swift
let items: [PDFElement] -
Init the section element
Declaration
Swift
init(columns: [SectionColumnWidth], items: [PDFElement] )Parameters
columnsThe columns of the section
itemsThe
PDFElementarray that will be drawn into the columns -
Draw the section element
Declaration
Swift
func draw(rect: inout CGRect, calculationOnly: Bool, pageRect: CGRect)Parameters
rectThe available rectangle
calculationOnlyBool if only the Bounding Rect should be calculated
pageRectThe page size of the PDF document
-
Calculate the width of the columns
Declaration
Swift
private func calculateColumnsWidth(rect: CGRect) -> [CGFloat]Parameters
rectThe available rectangle
Return Value
An
CGFloatarray with the width for each column -
Calculate the height of the section
Declaration
Swift
private func calculateSectionHeight( rowElements: [PDFElement], columnsWidth: [CGFloat], pageRect: CGRect ) -> CGFloatParameters
rowElementsThe
PDFElementarray in a rowcolumnWidthThe width of the column
Return Value
A
CGFloatwith the calculated height of the section
View on GitHub