Class

UIPrintPageRenderer

An object that draws pages of content that are to be printed, with or without the assistance of print formatters.

Declaration

@interface UIPrintPageRenderer : NSObject

Overview

A page renderer is an instance of a custom subclass of UIPrintPageRenderer. When you compose a print job using the shared instance of UIPrintInteractionController, you assign the page renderer to the printPageRenderer property of that instance. The subclass typically overrides one or more of the five draw... methods:

UIPrintPageRenderer usually requires you to specify the number of pages of printable content by overriding numberOfPages. It also allows you to specify the heights of page headers and footers.

You may assign one or more print formatters—that is, UIPrintFormatter objects that can lay out printable content of a certain kind—to specific page ranges of the content. For example, if your printable content is partially HTML, you may assign an instance of the UIMarkupTextPrintFormatter object to the starting page of HTML content. You assign a print formatter using the addPrintFormatter:startingAtPageAtIndex: method and you can get the print formatters for a given page by calling printFormattersForPageAtIndex:.

Topics

Accessing Information About the Print Job

numberOfPages

The number of pages to render.

paperRect

The size of the paper used for printing.

printableRect

The area in which printing can occur.

Specifying Header and Footer Heights

headerHeight

The height of the page header.

footerHeight

The height of the page footer.

Managing Print Formatters

- addPrintFormatter:startingAtPageAtIndex:

Adds a print formatter to the page renderer starting at the specified page.

- printFormattersForPageAtIndex:

Returns the print formatters associated with a specified page.

printFormatters

The print formatters associated with the page renderer.

Preparing for Drawing

- prepareForDrawingPages:

Overridden by the page renderer to prepare for drawing a range of pages.

Drawing a Page

- drawPageAtIndex:inRect:

Overridden to draw a given page of content for the printer.

- drawHeaderForPageAtIndex:inRect:

Overridden to draw the header of the given page.

- drawContentForPageAtIndex:inRect:

Overridden to draw the content of the given page.

- drawPrintFormatter:forPageAtIndex:

Overridden to add custom drawing to the drawing provided by a given print formatter for a page.

- drawFooterForPageAtIndex:inRect:

Overridden to draw the footer of the given page.

Relationships

Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software