PDFDocument

public class PDFDocument : CustomStringConvertible

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

PUBLIC VARS

PUBLIC INITIALIZERS

  • 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

Layout

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

    Declaration

    Swift

    public 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

Lines

  • 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

    public 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

Image

  • Adds an image to the given container.

    Declaration

    Swift

    public func add(_ container: PDFContainer = PDFContainer.contentLeft, image: PDFImage)

    Parameters

    container

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

    image

    Image object

  • Adds an image row to the given container. This image row will fill the full available width between left indentation and right indentation.

    Declaration

    Swift

    public func add(_ container: PDFContainer = PDFContainer.contentLeft, imagesInRow images: [PDFImage], spacing: CGFloat = 5.0)

    Parameters

    container

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

    images

    Array of images, from left to right

    spacing

    Horizontal distance between images

Text

Table

List

Section

Layout

Column Wrapping