Builder
class Builder
Class to build a PDF with PDFElement items
-
General document information
Declaration
Swift
let document: DocumentInfo -
Metadata info for the PDF file
Declaration
Swift
let auxiliaryInfo: [CFString: String] -
The optional current
PageHeaderFooterelementDeclaration
Swift
private var pageHeaderFooter: PDFBuild.PageHeaderFooter? -
The optional
PageCounterelementDeclaration
Swift
weak var pageCounter: PDFBuild.PageCounter? -
All the
PDFElement‘s for the documentDeclaration
Swift
var elements = [PDFElement]() -
The Quartz 2D drawing destination
Declaration
Swift
var pdfContext: CGContext? -
The page size of the PDF document
Declaration
Swift
var pageRect: CGRect = .zero -
Init the builder class
Declaration
Swift
init(documentInfo: PDFBuild.DocumentInfo)Parameters
documentInfoThe general document information
-
Generate a PDF document with all the added elements
Declaration
Swift
func generatePdf( progress: @escaping (Double) -> Void = { _ in } ) -> DataParameters
progressThe closure with progress indication
Return Value
A PDF document as
Data -
Append a page to the PDF document
Declaration
Swift
func appendPdf(progress: @escaping (Double) -> Void = { _ in })Parameters
progressThe closure with progress indication
-
Begin a new PDF page
Declaration
Swift
private func beginPage() -> CGRectReturn Value
The rectangle of the new page
-
End the current PDF page
Declaration
Swift
private func endPage()
-
Begin a new PDF page
Declaration
Swift
func beginPdfPage() -
Begin a new PDF page
Declaration
Swift
func beginPdfContextToData(pageRect: CGRect) -> NSMutableDataParameters
pageRectThe rectangle of the page
Return Value
The PDF page as
NSMutableData -
End the current PDF page
Declaration
Swift
func endPdfContext()
View on GitHub