---
title: "UIGraphicsSetPDFContextDestinationForRect(_:_:)"
framework: uikit
role: symbol
role_heading: Function
path: "uikit/uigraphicssetpdfcontextdestinationforrect(_:_:)"
---

# UIGraphicsSetPDFContextDestinationForRect(_:_:)

Links a rectangular area on the current page to the specified jump destination.

## Declaration

```swift
func UIGraphicsSetPDFContextDestinationForRect(_ name: String, _ rect: CGRect)
```

## Parameters

- `name`: A named destination in the PDF document. This is the same name you used when creating the jump destination using the doc://com.apple.uikit/documentation/UIKit/UIGraphicsAddPDFContextDestinationAtPoint(_:_:) function.
- `rect`: A rectangle on the current page of the PDF context.

## Discussion

Discussion You use this function to create live links within a PDF document. Tapping the specified rectangle in the PDF document causes the document to display the contents at the associated jump destination. If the current graphics context is not a PDF context, this function does nothing.

## See Also

### PDF creation

- [UIGraphicsBeginPDFContextToData(_:_:_:)](uikit/uigraphicsbeginpdfcontexttodata(_:_:_:).md)
- [UIGraphicsBeginPDFContextToFile(_:_:_:)](uikit/uigraphicsbeginpdfcontexttofile(_:_:_:).md)
- [UIGraphicsEndPDFContext()](uikit/uigraphicsendpdfcontext().md)
- [UIGraphicsBeginPDFPage()](uikit/uigraphicsbeginpdfpage().md)
- [UIGraphicsBeginPDFPageWithInfo(_:_:)](uikit/uigraphicsbeginpdfpagewithinfo(_:_:).md)
- [UIGraphicsGetPDFContextBounds()](uikit/uigraphicsgetpdfcontextbounds().md)
- [UIGraphicsAddPDFContextDestinationAtPoint(_:_:)](uikit/uigraphicsaddpdfcontextdestinationatpoint(_:_:).md)
- [UIGraphicsSetPDFContextURLForRect(_:_:)](uikit/uigraphicssetpdfcontexturlforrect(_:_:).md)
