Skip to content

pilot34/iOS-PDF-Reader

 
 

Repository files navigation

iOS-PDF-Reader

Version License Platform Carthage compatible

PDF Reader for iOS written in Swift

  • Fast and lightweight
  • Thumbnail bar on the bottom to navigate to a specific page
  • Print button on the top right

Example

Example

Requirements

  • iOS 9.0+

Installation

CocoaPods

To install it, simply add the following line to your Podfile:

pod 'PDFReader'

You will also need to make sure you're opting into using frameworks:

use_frameworks!

Then run pod install with CocoaPods 1.0 or newer.

Carthage

To install it, simply add the following line to your Cartfile:

github "Alua-Kinzhebayeva/iOS-PDF-Reader"

Run carthage update to build the framework and drag the built PDFReader.framework into your Xcode project.

Usage

let documentURL = NSBundle.mainBundle().URLForResource("Cupcakes", withExtension: "pdf")!
let document = PDFDocument(fileURL: documentURL)

let storyboard = UIStoryboard(name: "PDFReader", bundle: NSBundle(forClass: PDFViewController.self))
let controller = storyboard.instantiateInitialViewController() as! PDFViewController
controller.document = document
controller.title = document.fileName
navigationController?.pushViewController(controller, animated: true)

Customizations

Customize the action button image of the right menu bar item

controller.actionButtonImage = UIImage(named: "printButtonImage")

Acknowledgements

inspired by PDF Reader https://github.com/vfr/Reader and Apple's example on TiledScrollView

About

PDF Reader for iOS written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 72.6%
  • Shell 22.6%
  • Objective-C 2.8%
  • Ruby 2.0%