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
let firstPage: Int -
The current page number
Declaration
Swift
var pageNumber: Int -
The attributes for the page counter string
Declaration
Swift
let attributes: PDFStringAttribute -
The TOC items in the document
Note
TheContentItemelement can add elements to this arrayDeclaration
Swift
var tocItems: [TOCInfo] = [] -
Init the page counter element
Declaration
Swift
init(firstPage: Int, attributes: PDFStringAttribute = PDFStringAttribute())Parameters
firstPageThe number of the first page
attributesThe attributes for the page counter string
-
Draw the page counter element with a
TextelementDeclaration
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