PDFMultiDocumentGenerator

public class PDFMultiDocumentGenerator : PDFGeneratorProtocol

Generates a PDF from multiple PDFDocument by appending them.

  • Instance of Progress used to track and control the multi-document generation

    Declaration

    Swift

    public let progress: Progress
  • Instances of Progess used to track and control each individual document generation

    Declaration

    Swift

    public let progresses: [Progress]
  • Flag to enable or disable the debug overlay

    Declaration

    Swift

    public var debug: Bool
  • Initializes a new multi-document generator for generating the giving documents.

    It will use the page layout of the first document.

    The instance property progress is initialized to the total document count.

    Declaration

    Swift

    public init(documents: [PDFDocument] = [])

    Parameters

    documents

    Array of PDFDocument instances, which will all be rendered into a single PDF context

  • nodoc

    Declaration

    Swift

    public func generateURL(filename: String) throws -> URL
  • nodoc

    Declaration

    Swift

    public func generate(to target: URL) throws
  • Creates a file at the given file URL, generates the PDF context data and writes the result idata nto the file.

    Throws

    Exception, if something went wrong

    Declaration

    Swift

    public func generate(to target: URL, info: PDFInfo?) throws

    Parameters

    target

    URL of output file,

    info

    Instance of PDFInfo with meta file information, defaults to default initializer of PDFInfo

  • nodoc

    Declaration

    Swift

    public func generateData() throws -> Data
  • Generates and returns the PDF context data.

    Throws

    Exception, if something went wrong

    Declaration

    Swift

    public func generateData(info: PDFInfo? = nil) throws -> Data

    Parameters

    info

    Instance of PDFInfo with meta file information, defaults to default initializer of PDFInfo

    Return Value

    PDF data