PDFGenerator
public class PDFGenerator : PDFGeneratorProtocol, CustomStringConvertible
Factory which converts a document into a PDF file
-
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
-
Enables debugging on all generator instance
Declaration
Swift
public var debug: Bool
-
Initializes the generator with a document.
Declaration
Swift
public init(document: PDFDocument)
Parameters
document
The document which will be converted
-
nodoc
Declaration
Swift
public func generateURL(filename: String) throws -> URL
-
nodoc
Declaration
Swift
public func generate(to url: URL) throws
-
Generates PDF data and writes it to a temporary file.
Throws
PDFError
Declaration
Swift
public func generate(to url: URL, info: PDFInfo?) throws
Parameters
to
URL where file should be saved.
info
PDF file information
-
nodoc
Declaration
Swift
public func generateData() throws -> Data
-
Generates PDF data and returns it
Throws
PDFError
Declaration
Swift
public func generateData(info: PDFInfo?) throws -> Data
Parameters
document
PDFDocument which should be converted into a PDF file.
info
Metadata Information added to file
Return Value
PDF Data
-
Generate PDF Context from PDFCommands
Throws
PDFErrorDeclaration
Swift
public func generatePDFContext(context: PDFContext) throws
-
Creates a list of container-object pairs which will be rendered.
Declaration
Swift
public func createRenderObjects() throws -> [PDFLocatedRenderObject]
Return Value
List of renderable objects