Guest User

Untitled

a guest
Nov 16th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. let pdf = renderer.pdfData { (context) in
  2. let attributes = [ NSFontAttributeName : UIFont.boldSystemFont(ofSize: 15) ]
  3. // page 1
  4. context.beginPage()
  5. NSAttributedString(string: "Page 1", attributes: attributes).draw(in: CGRect(x: 0, y: 0, width: 500, height: 200))
  6.  
  7. // page 2
  8. context.beginPage()
  9. NSAttributedString(string: "Page 2", attributes: attributes).draw(in: CGRect(x: 0, y: 0, width: 500, height: 200))
  10.  
  11. // page 3
  12. context.beginPage()
  13. NSAttributedString(string: "Page 3", attributes: attributes).draw(in: CGRect(x: 0, y: 0, width: 500, height: 200))
  14.  
  15. // Now that I know that the PDF will have 3 pages, add the footer on all 3 pages - but how?
  16. }
  17. }
Add Comment
Please, Sign In to add comment