iOS Developer Library

Developer

UIKit Framework Reference UIPrintPaper Class Reference

Options
Deployment Target:

On This Page
Language:

UIPrintPaper

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. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 4.2 and later.
  • paperSize paperSize Property

    The size of the sheet to be used for printing. (read-only)

    Declaration

    Swift

    var paperSize: CGSize { get }

    Objective-C

    @property(readonly) CGSize paperSize

    Discussion

    The paper size is often associated with a standard designation, such as “Letter” and “A4”. For example, the paper size for a Letter sheet of paper is 612 points wide and 792 points high.

    Import Statement

    import UIKit

    Availability

    Available in iOS 4.2 and later.

    See Also

    printableRect

  • The rectangle that represents the portion of the paper that can be imaged upon. (read-only)

    Declaration

    Swift

    var printableRect: CGRect { get }

    Objective-C

    @property(readonly) CGRect printableRect

    Discussion

    Typically, UIKit passes this value into the last argument of the UIPrintPageRenderer method drawPageAtIndex:inRect:.

    Import Statement

    import UIKit

    Availability

    Available in iOS 4.2 and later.

    See Also

    paperSize

  • Returns the print-paper object that UIKit determines to be the best for a print job based on the given page size and the paper size–imageable area combinations specific to the printer.

    Declaration

    Swift

    class func bestPaperForPageSize(_ pageSize: CGSize, withPapersFromArray paperList: [AnyObject]!) -> UIPrintPaper?

    Objective-C

    + (UIPrintPaper *)bestPaperForPageSize:(CGSize)pageSize withPapersFromArray:(NSArray *)paperList

    Parameters

    pageSize

    The size of the printed page that your application requests, in points. You should think of this as the size of the physical sheet of paper to use in printing without consideration of the margin.

    paperList

    An array of UIPrintPaper objects that represent combinations of supported paper size and printable areas. The array of objects usually comes directly from the second argument of the printInteractionController:choosePaper: method of the UIPrintInteractionControllerDelegate protocol.

    Return Value

    An instance of UIPrintPaper that represents the optimal printable area and paper size for the current print job. Returns nil if the instance could not be created.

    Discussion

    The delegate of UIPrintInteractionController may call this method in its implementation of the printInteractionController:choosePaper: method declared in the UIPrintInteractionControllerDelegate protocol.

    Import Statement

    import UIKit

    Availability

    Available in iOS 4.2 and later.