Skip to content

This is a sample project of Swift Pdf reader that done by using vrf reader objective c class

Notifications You must be signed in to change notification settings

nitingohel/NGSwiftPdfReader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NGSwiftPdfReader

This is a sample project of Swift2x Pdf reader that done by using vrf reader objective c class

RunTime Output

ScreenShot

How to use:

  • First you need to create a Bridge header file in to you swift project.
  • Then you need to add vfr required file in to you project (that will be attached in my Sample code).
  • Now you need to set import statement in to Bridge Header file.
#ifndef Bridge_Header_h
#define Bridge_Header_h
#import "ReaderViewController.h"
#endif /* Bridge_Header_h */
  • Add this Bridge file in to Project->target-> build Setting -> Objective-c Bridging Header and set Bridge file.
  • Now Opne your project View Controller from that you wish to open pdf set Delegate file like:
class ViewController: UIViewController , ReaderViewControllerDelegate {

ViewDiDLoad

override func viewDidLoad() {
        super.viewDidLoad()
        let filepath = (NSBundle.mainBundle().pathForResource("Reader", ofType:"pdf"))! as String

        if let document = ReaderDocument.withDocumentFilePath(filepath, password: "")
        {
            let readerViewController: ReaderViewController = ReaderViewController(readerDocument: document)
            readerViewController.delegate = self
            // Set the ReaderViewController delegate to self
            self.navigationController!.pushViewController(readerViewController, animated: true)
        }
    }

That all creadit gose to vfr/Reader i just make this sample using https://github.com/vfr/Reader in swift project

About

This is a sample project of Swift Pdf reader that done by using vrf reader objective c class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published