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 NSColor background of the label

    Declaration

    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

    leadingText

    The optional leading text of the label

    labelText

    The text of the label

    backgroundColor

    The NSColor background of the label

    alignment

    The alignment of the label

  • Draw the label 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