<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewPrintFormatter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewPrintFormatter"
  },
  "title" : "UIViewPrintFormatter"
}
-->

# UIViewPrintFormatter

An object that lays out the drawn content of a view for printing.

```
class UIViewPrintFormatter
```

## Overview

Instances of three system classes offer usable view print formatters to applications: [`UIWebView`](/documentation/UIKit/UIWebView) and [`UITextView`](/documentation/UIKit/UITextView) of the UIKit framework, and <doc://com.apple.documentation/documentation/MapKit/MKMapView> of the MapKit framework. To obtain a view print formatter for a print job, call the [`UIView`](/documentation/UIKit/UIView) method [`viewPrintFormatter()`](/documentation/UIKit/UIView/viewPrintFormatter()) and initialize the print formatter’s inherited layout properties.

Add the print formatter to the print job in one of two ways:

- If a single print formatter is being used for the print job (with no additional drawing), assign it to the [`printFormatter`](/documentation/UIKit/UIPrintInteractionController/printFormatter) property of the [`UIPrintInteractionController`](/documentation/UIKit/UIPrintInteractionController) shared instance. The inherited [`startPage`](/documentation/UIKit/UIPrintFormatter/startPage) property identifies the beginning page of content with which the formatter is associated.
- If you are using multiple formatters along with a page renderer, associate each print formatter with a starting page of the printed content. You often take this approach when you want to add content such as headers and footers to what the formatters provide. You have two ways of associating a print formatter with a  [`UIPrintPageRenderer`](/documentation/UIKit/UIPrintPageRenderer) object:
- You can add print formatters to the [`printFormatters`](/documentation/UIKit/UIPrintPageRenderer/printFormatters)  property of the [`UIPrintPageRenderer`](/documentation/UIKit/UIPrintPageRenderer) object; the [`startPage`](/documentation/UIKit/UIPrintFormatter/startPage) property of the print formatter specifies the starting page
- You can add print formatters by calling [`addPrintFormatter(_:startingAtPageAt:)`](/documentation/UIKit/UIPrintPageRenderer/addPrintFormatter(_:startingAtPageAt:)) for each print formatter; the second parameter of this method specifies the starting page (and overrides any [`startPage`](/documentation/UIKit/UIPrintFormatter/startPage) value).

View print formatters typically implement the [`UIView`](/documentation/UIKit/UIView) method [`draw(_:for:)`](/documentation/UIKit/UIView/draw(_:for:)) to draw content in a way that is suitable for printing, If they don’t implement this method, their [`draw(_:)`](/documentation/UIKit/UIView/draw(_:)) method is called instead.

### Subclassing Notes

Subclassing `UIViewPrintFormatter` to print the contents of a view is not recommended. To print the contents of a custom view, you should instead draw the view’s contents for printing using a custom [`UIPrintPageRenderer`](/documentation/UIKit/UIPrintPageRenderer) object.

## Topics

### Accessing the view

[`view`](/documentation/UIKit/UIViewPrintFormatter/view)

The view from which the view print formatter was derived.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)