Builder
public 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 margins for the page
Declaration
Swift
let pageMargin: NSEdgeInsets
-
The optional current
PageHeaderFooter
elementDeclaration
Swift
private var pageHeaderFooter: PDFBuild.PageHeaderFooter?
-
The optional
PageCounter
elementDeclaration
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(info: PDFBuild.DocumentInfo)
Parameters
info
The general document information
-
Generate a PDF document with all the added elements
Declaration
Swift
public func generatePdf( progress: @escaping (Double) -> Void = { _ in } ) -> Data
Parameters
progress
The closure with progress indication
Return Value
A PDF document as
Data
-
Append a page to the PDF document
Declaration
Swift
public func appendPdf(progress: @escaping (Double) -> Void = { _ in })
Parameters
progress
The closure with progress indication
-
Begin a new PDF page
Declaration
Swift
private func beginPage() -> CGRect
Return 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) -> NSMutableData
Parameters
pageRect
The rectangle of the page
Return Value
The PDF page as
NSMutableData
-
End the current PDF page
Declaration
Swift
func endPdfContext()