UIViewPrintFormatter Class Reference

Inherits from
Conforms to
Available in iOS 4.2 and later.
Companion guide
Declared in
Related sample code


An instance of the UIViewPrintFormatter class lays out the drawn content of a view for printing. The view’s content can span multiple pages.

Instances of three system classes offer usable view print formatters to applications: UIWebView and UITextView of the UIKit framework, and MKMapView of the Map Kit framework. To obtain a view print formatter for a print job, call the UIView method viewPrintFormatter and initialize the print formatter’s inherited layout properties.

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

View print formatters typically implement the the UIView method drawRect:forViewPrintFormatter: to draw content in a way that is suitable for printing, If they don’t implement this method, their drawRect: 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 object.


Accessing the View



The view from which the view print formatter was derived. (read-only)

@property(nonatomic, readonly) UIView *view

You obtain a view print formatter by calling viewPrintFormatter on a UIView object.

  • Available in iOS 4.2 and later.
Declared In