PDFDocument

public class PDFDocument : PDFJSONSerializable

The main class users interact with. This object holds the information about the document and also all PDF objects.

It is possible to create a JSON representation using the PDFJSONSerializable protocol.

  • Holds all layout information

    Declaration

    Swift

    public var layout: PDFPageLayout
  • Holds all document information

    Declaration

    Swift

    public var info: PDFInfo
  • Holds all pagination information

    Declaration

    Swift

    public var pagination: PDFPagination
  • Holds strong references to all text styles

    Declaration

    Swift

    public var styles: [PDFTextStyle]
  • Creates a new document with the given layout

    Declaration

    Swift

    public init(layout: PDFPageLayout)

    Parameters

    layout

    Layout information for document

  • Creates a new document with a predefined PDFPageFormat

    Declaration

    Swift

    public init(format: PDFPageFormat)

    Parameters

    layout

    Predefined page formats

  • Adds a empty space in the given container, between the previous and the next element

    Declaration

    Swift

    func add(_ container: PDFContainer = PDFContainer.contentLeft, space: CGFloat)

    Parameters

    container

    Container where the space will be set, defaults to PDFContainer.contentLeft

    space

    Space distance in points

  • TODO: Documentation

    Declaration

    Swift

    @available(*, deprecated, renamed: "add(_:space:﹚")
    func addSpace(_ container: PDFContainer = PDFContainer.contentLeft, space: CGFloat)
  • Adds a horizontal line spearator to the given container. The line starts at the left indentation and ends at the right indentation. Customize by adjusting parameter style.

    Declaration

    Swift

    func addLineSeparator(_ container: PDFContainer = PDFContainer.contentLeft, style: PDFLineStyle)

    Parameters

    container

    Container where the space will be set, defaults to PDFContainer.contentLeft

    style

    Style of line

  • Adds a section object to the document

    Declaration

    Swift

    func add(section: PDFSection)
  • TODO: Documentation

    Declaration

    Swift

    @available(*, deprecated, renamed: "add(_:section:﹚")
    func addSection(_ section: PDFSection)