Class

UIGraphicsPDFRendererFormat

A set of drawing attributes that represents the configuration of a PDF renderer context.

Declaration

class UIGraphicsPDFRendererFormat : UIGraphicsRendererFormat

Overview

Use this subclass of UIGraphicsRendererFormat to provide context configuration parameters to a UIGraphicsPDFRenderer.

Create an instance and then add PDF configuration parameters to the documentInfo dictionary.

Listing 1 demonstrates how you can use a PDF renderer format object to specify the author of the PDFs created by a PDF renderer.

Listing 1

Creating a PDF renderer format to specify the author of the PDF

let format = UIGraphicsPDFRendererFormat()
format.documentInfo = [ kCGPDFContextAuthor as String : "Kate Bell" ]
let renderer =
  UIGraphicsPDFRenderer(bounds: CGRect(x: 0, y: 0, width: 500, height: 300),
                        format: format)

Topics

Getting the PDF Document Info

var documentInfo: [String : Any]

A dictionary that specifies additional information to be associated with the PDFs created by the PDF renderer.

Relationships

Conforms To

See Also

Drawing Contexts

class UIGraphicsRenderer

An abstract base class for creating graphics renderers.

class UIGraphicsRendererContext

The base class for the drawing environments associated with graphics renderers.

class UIGraphicsRendererFormat

A set of drawing attributes that represent the configuration of a graphics renderer context.

class UIGraphicsImageRenderer

A graphics renderer for creating Core Graphics-backed images.

class UIGraphicsImageRendererContext

The drawing environment associated with an image renderer.

class UIGraphicsImageRendererFormat

A set of drawing attributes that represent the configuration of an image renderer context.

class UIGraphicsPDFRenderer

A graphics renderer for creating PDFs.

typealias UIGraphicsPDFRenderer.DrawingActions

A handler block that you use to draw PDF content.

class UIGraphicsPDFRendererContext

A drawing environment associated with a PDF renderer.