PDFGenerator
public class PDFGenerator : PDFGeneratorProtocol, CustomStringConvertible
Factory to convert a single PDFDocument
into a PDF file
This is one of the main classes used to interact with the framework.
The PDFGenerator
is a stateful object which should be used exactly once per generator task.
-
Total page count used for displaying in rendered PDF
Declaration
Swift
public var totalPages: Int
-
Relative value tracking progress
Declaration
Swift
public let progress: Progress
-
Object acts as a delegate during the generation process
Declaration
Swift
public var delegate: PDFGeneratorDelegate?
-
Enables the debugging mode, which will render additional visual information on different elements.
Declaration
Swift
public var debug: Bool
-
Initializes the generator with a
PDFDocument
`.Declaration
Swift
public init(document: PDFDocument)
Parameters
document
The document which will be used to create the PDF document file
-
Convenience method for
generate(to:info:)
withoutinfo
Declaration
Swift
func generateURL(filename: String) throws -> URL
-
Convenience method for
generate(to:info:)
withoutinfo
Declaration
Swift
func generate(to url: URL) throws
-
Convenience method for
generateData(info:)
without defininginfo
Declaration
Swift
func generateData() throws -> Data
-
Generate PDF Context from PDFCommands
Throws
PDFError
if the calculations or rendering failsDeclaration
Swift
func generatePDFContext(context: PDFContext) throws
-
Creates a list of container-object pairs which will be rendered.
Throws
PDFError
if the calculations failDeclaration
Swift
func createRenderObjects() throws -> [PDFLocatedRenderObject]
Return Value
List of renderable objects