PDFGeneratorProtocol

public protocol PDFGeneratorProtocol : AnyObject

Protocol including all public methods and accessors available for generating documents

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

    Declaration

    Swift

    var progress: Progress { get }
  • Flag to enable or disable the debug overlay

    Declaration

    Swift

    var debug: Bool { get set }
  • generateURL(filename:info:) Default implementation

    Creates a file in a guaranteed temporary folder with the given filename, generates the PDF context data and writes the result into the file.

    Keep in mind, the output file is in a temporary folder of the OS and should be persisted by your own logic.

    Throws

    Exception, if something went wrong

    Default Implementation

    Creates a file in a guaranteed temporary folder with the given filename, generates the PDF context data and writes the result into the file.

    Keep in mind, the output file is in a temporary folder of the OS and should be persisted by your own logic.

    Throws

    Exception, if something went wrong

    Declaration

    Swift

    func generateURL(filename: String, info: PDFInfo?) throws -> URL

    Parameters

    filename

    Name of output file, .pdf will be appended if not given

    info

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

    Return Value

    Temporary URL to the output file

  • Creates a file in a guaranteed temporary folder with the given filename, generates the PDF context data and writes the result into the file.

    Keep in mind, the output file is in a temporary folder of the OS and should be persisted by your own logic.

    Throws

    Exception, if something went wrong

    Declaration

    Swift

    func generateURL(filename: String) throws -> URL

    Parameters

    filename

    Name of output file, .pdf will be appended if not given

    Return Value

    Temporary URL to the output file

  • 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

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

    Parameters

    target

    URL of output file,

    info

    Instance of PDFInfo with meta file information

  • 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

    func generate(to url: URL) throws

    Parameters

    target

    URL of output file,

  • Generates and returns the PDF context data.

    Throws

    Exception, if something went wrong

    Declaration

    Swift

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

    Parameters

    info

    Instance of PDFInfo with meta file information

    Return Value

    PDF data

  • Generates and returns the PDF context data.

    Throws

    Exception, if something went wrong

    Declaration

    Swift

    func generateData() throws -> Data

    Return Value

    PDF data