Instance Method

drawPage(at:in:)

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

Declaration

func drawPage(at pageIndex: Int, in printableRect: CGRect)

Parameters

index

The index of the page to draw.

pageRect

The rectangle in which printable content can be drawn.

Discussion

The default implementation of this method calls, in sequence, drawHeaderForPage(at:in:), drawContentForPage(at:in:), drawPrintFormatter(_:forPageAt:), and drawFooterForPage(at:in:). The method is set up for drawing to the current graphics context (as returned by UIGraphicsGetCurrentContext()).

See Also

Drawing a Page

func drawHeaderForPage(at: Int, in: CGRect)

Overridden to draw the header of the given page.

func drawContentForPage(at: Int, in: CGRect)

Overridden to draw the content of the given page.

func drawPrintFormatter(UIPrintFormatter, forPageAt: Int)

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

func drawFooterForPage(at: Int, in: CGRect)

Overridden to draw the footer of the given page.