print multiple pages

func drawPDFUsingPrintPageRenderer(printPageRenderer: UIPrintPageRenderer) -> NSData! { let data = NSMutableData() UIGraphicsBeginPDFContextToData(data, CGRect.zero, nil) for i in 0..<printPageRenderer.numberOfPages { UIGraphicsBeginPDFPage() printPageRenderer.drawPage(at: i, in: UIGraphicsGetPDFContextBounds()) } UIGraphicsEndPDFContext() return data }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.