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:
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!
Here are some of the most common culprits to consider: Your laptop doesn't have a PDF reader installed. Your PDF reader or preferred program is out of date and needs an update. Your PDF application is potentially damaged or needs to be rebooted.
Once in Adobe Reader, click the Edit menu in the menu bar, and then clickPreferences... The Preferences window will open. In the Categories section, click on Internet. Make sure the first check box, Display PDF in browser, is checked.
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.
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
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With