PDFGenerator

public class PDFGenerator : PDFGeneratorProtocol, CustomStringConvertible

Factory which converts a document into a PDF file

INTERNAL VARS

  • 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

PUBLIC INITS

  • Initializes the generator with a document.

    Declaration

    Swift

    public init(document: PDFDocument)

    Parameters

    document

    The document which will be converted

PUBLIC FUNCS

  • 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

INTERNAL FUNCS