Skip to content

umakanta/UKPDFReader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UKPDFReader

CI Status Version License Platform

UKPDFReader is a simple framework for reading PDF in iOS

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 11.0+
  • Swift 4

Installation

UKPDFReader is available through CocoaPods.

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

pod 'UKPDFReader'
use_frameworks!

Then run pod install with CocoaPods 1.0 or newer.

Usage

Import Framework

import UKPDFReader

Once the pdf file in NSBundle, get the bundle path

guard let path = Bundle.main.url(forResource: "swift", withExtension: "pdf") else {
            print("failed to unwrap fileURL")
            return
        }

Create an instance of UKPDFViewController by providing 'path of pdf file' and passing self as delegate

let pdfViewController = UKPDFViewController(pdfUrl: path, delegate: self)

Customize the PDFReader by providing some values. All values are optional

  pdfViewController.pdfDisplayDirection = .horizontal
  pdfViewController.showContentsButton = true
  pdfViewController.pdfTitle = "UKPdfReader"
  
  pdfViewController.customizeNavBar(titleTextcolor: .red, titleFont: UIFont.boldSystemFont(ofSize: 24.0), buttonTextcolor: .blue, buttonFont: UIFont.boldSystemFont(ofSize: 18.0))

Then, Presenting the UKPDFViewController

let navController = UINavigationController.init(rootViewController: pdfViewController)
present(navController, animated: true, completion: nil)

License

UKPDFReader is available under the MIT license. See the LICENSE file for more info.

About

UKPDFReader is a simple framework for reading PDF in iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published