An abstract base class for print formatters, which are objects that lay out custom printable content that can cross page boundaries.
SDKs
- iOS 4.2+
- Mac Catalyst 13.0+
Framework
- UIKit
Declaration
class UIPrintFormatter : NSObject
Overview
Given a print formatter, the printing system can automate the printing of the type of content associated with the print formatter. Examples of such content could be a web view, a mix of images and text, or a long text document. The UIKit framework provides several concrete subclasses of UIPrint
: UISimple
, UIMarkup
, and UIView
.
You can assign a single print formatter for a print job via the print
property of the UIPrint
shared instance; or you can specify one or more print formatters that are associated with specific pages of a page renderer through the add
method of UIPrint
. A page renderer is an instance of a custom subclass of UIPrint
that draws content for printing.
UIPrint
publishes an interface that allows you to specify the starting page for a print job and the margins around the printed content; given that information plus the content, a print formatter computes the number of pages for the print job. Figure 1 depicts the print-formatter properties, along with certain UIPrint
and UIPrint
properties, that define the layout of a multi-page print job.
Layout of printed content

Third-party subclasses of UIPrint
are not recommended. If you have custom content to print, use a custom UIPrint
object.