Instance Method

drawPrintFormatter(_:forPageAt:)

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

Declaration

func drawPrintFormatter(_ printFormatter: UIPrintFormatter, forPageAt pageIndex: Int)

Parameters

printFormatter

A UIPrintFormatter object associated with page index.

index

The index of the page in which printFormatter is to draw.

Discussion

This method is invoked for each print formatter assigned to the specified page. The default implementation invokes the draw(in:forPageAt:) method of the UIPrintFormatter object that is passed in. You can override this method to intermix custom drawing with the formatter drawing—for example, by adding an overlay or underlay graphic. Call draw(in:forPageAt:) to have the print formatter draw its portion of the page. The method is set up for drawing to the current graphics context (as returned by UIGraphicsGetCurrentContext()).

See Also

Drawing a Page

func drawPage(at: Int, in: CGRect)

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

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 drawFooterForPage(at: Int, in: CGRect)

Overridden to draw the footer of the given page.