Class

UIGraphicsPDFRendererContext

A drawing environment associated with a PDF renderer.

Declaration

class UIGraphicsPDFRendererContext : UIGraphicsRendererContext

Overview

When using the UIGraphicsPDFRenderer drawing methods, you must pass a block of type UIGraphicsPDFRenderer.DrawingActions as an argument, which provides a UIGraphicsPDFRendererContext instance as an argument. Use the context object to access high-level drawing functions and the underlying Core Graphics context.

To learn how to use a UIGraphicsPDFRendererContext object in combination with a PDF renderer, see Creating a Graphics PDF Renderer.

Topics

Marking New Pages

func beginPage()

Marks the beginning of a new page in the PDF context and configures it using default values.

func beginPage(withBounds: CGRect, pageInfo: [String : Any])

Marks the beginning of a new page in the PDF context and configures it using the specified values.

Getting the PDF Bounds

var pdfContextBounds: CGRect

The bounds of the PDF context for the current page.

Managing Destinations

func addDestination(withName: String, at: CGPoint)

Creates a named destination point in the current PDF page.

func setDestinationWithName(String, for: CGRect)

Creates a link rectangle in the current page that when clicked, will jump the PDF viewer to the named destination.

func setURL(URL, for: CGRect)

Creates a link to an external resource defined by a URL

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 UIGraphicsPDFRendererFormat

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