5

I am looking for an IOS PDF viewer for a Swift iPad application I am working on. Using UI Web View does not really have enough functionality that I need for the app to work smoothly. Here is what I need:

  • Search in the Document (not necessary)
  • Jump to a page
  • Download to local storage
  • Update to newest version when connected to the internet

I understand that not all of these have to do with the actual PDF viewer, but I listed them because they will eventually need to work with the PDF viewer. I am very reluctant to try and use one of the many PDF viewers that are out there, because I am looking for something that looks professional and is pretty simple.

Should I use a PDF viewer kit or try to customize the UI Web View a little bit? I am not sure what to do in this situation. Help is appreciated!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mike Schmidt
  • 945
  • 3
  • 12
  • 31

2 Answers2

10

I think your best bet is Quick Look Framework from Apple. It is extremely smooth and easy to use. You can have a list of many documents and switch between them while previewing document. Moreover, it is the viewer used everywhere in iOS, so users are already familiar with it and it comes with all basic functionalities (zoom, select, copy/paste, ...).

A good tutorial is Using Quick Look Framework for Previewing Documents with Swift.

AnthoPak
  • 4,191
  • 3
  • 23
  • 41
4

I suggest to use M13PDFKit. Its quite easy and have more functionalities such as thumbnails view and swipe to right.

Your code would be simple as

// get main viewer controller
let viewerController = self.storyboard?.instantiateViewControllerWithIdentifier("PDFChildViewController") as! PDFChildViewController

// pass the file path / string url
let document = PDFKDocument(contentsOfFile: filePath , password: nil)
viewerController.loadDocument(document)

// present
self.presentViewController(viewerController, animated: true, completion: { 
    // do something when start present the pdf
})
h8d8now
  • 68
  • 5