Label
class Label: PDFElement
A PDF label element
-
The optional leading text of the label
Declaration
Swift
let leadingText: NSAttributedString? -
The text of the label
Declaration
Swift
let labelText: NSAttributedString -
The
NSColorbackground of the labelDeclaration
Swift
let backgroundColor: NSColor -
The alignment of the label
Declaration
Swift
let alignment: NSTextAlignment -
The corner radius of the label
Declaration
Swift
let cornerRadius: CGFloat = 3 -
Init the label element
Declaration
Swift
init( leadingText: NSAttributedString? = nil, labelText: NSAttributedString, backgroundColor: NSColor, alignment: NSTextAlignment )Parameters
leadingTextThe optional leading text of the label
labelTextThe text of the label
backgroundColorThe
NSColorbackground of the labelalignmentThe alignment of the label
-
Draw the label 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
View on GitHub