An instance of the
UIPrintPaper class encapsulates the size of paper used for a print job and the rectangle in which content can be printed.
- iOS 4.2+
In most cases, UIKit automatically creates an instance of
UIPrintPaper that is appropriate for a print job. The UIKit framework has default paper sizes based on a print job’s output type (
outputType is a property of the
UIPrintInfo class). If the output type is
photo, the default paper size is 4x6 or A6 or some other standard size, depending on locale; if the output type is
grayscale, the default paper size is US Letter (8 1/2 by 11 inches) or A4 or some other standard size, depending on locale.
Applications may have special requirements for paper sizes. For example, a word-processing application may have items of “stationery” in which printable content must be drawn. If your application fits the special case, the delegate of
UIPrintInteractionController can implement the
printInteractionController(_:choosePaper:) method of the
UIPrintInteractionControllerDelegate protocol to return a suitable
UIPrintPaper object. One way to do this is to call the
bestPaper(forPageSize:withPapersFrom:) class method of
UIPrintPaper, passing in a array of
UIPrintPaper objects representing the paper sizes supported by a printer. The
UIPrintPaper object returned from this method represents the paper size best matched to the size requirement of the application.
The printable rectangle (
printableRect) is the imageable area for the printer on a paper of a given size.
If you are using a
UIPrintPageRenderer object to draw the content for printing, the rectangle stored in the
printableRect property is stored in the page renderer’s property of the same name and the paper size used for a print job is stored as part of the