0

As I am new to swift and iOS, I am working on a app where I need to read the content of the PDF and populate on the viewcontroller(textlabel), please let me know how to do it using swift

Thanks in advance

uday kaja
  • 1
  • 1

1 Answers1

0

You may want to read more about CGPDFDocument

A quick snippet that will get the number of pages of the PDF

var pdfDoc: CGPDFDocumentRef!
var numberOfPages: Int = 0
let pdfURL = NSBundle.mainBundle().URLForResource("myPDFDocument", withExtension: "pdf")
pdfDoc = CGPDFDocumentCreateWithURL(pdfURL)
numberOfPages = CGPDFDocumentGetNumberOfPages(pdfDoc) as Int
Leo Dabus
  • 229,809
  • 59
  • 489
  • 571
Subbu
  • 2,138
  • 14
  • 20