PageCounter
class PageCounter: PDFElement
A PDF page counter element
- Keep a list of items for the TOC
- Drawing of the page counter
-
The number of the first page
Declaration
Swift
public let firstPage: Int
-
The current page number
Declaration
Swift
public var pageNumber: Int
-
The attributes for the page counter string
Declaration
Swift
public let attributes: SWIFTStringAttribute
-
The TOC items in the document
Note
TheContentItem
element can add elements to this arrayDeclaration
Swift
public var tocItems: [TOCInfo] = []
-
Init the page counter element
Declaration
Swift
init(firstPage: Int, attributes: SWIFTStringAttribute = SWIFTStringAttribute())
Parameters
firstPage
The number of the first page
attributes
The attributes for the page counter string
-
Draw the page counter element with a
Text
elementDeclaration
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