Giter Site home page Giter Site logo

ihusnainaali / mbdoccapture Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohsinalimat/mbdoccapture

0.0 0.0 0.0 20.94 MB

MBDocCapture makes it easy to add document scanning functionalities to your iOS app but also image editing (Cropping and contrast enhacement).

License: MIT License

Swift 99.27% Ruby 0.73%

mbdoccapture's Introduction

MBDocCapture

Version License Platform

MBDocCapture makes it easy to add document scanning functionalities to your iOS app but also image editing (Cropping and contrast enhacement).

Features

  • Doc scanning
  • Photo cropping and enhancement
  • Auto scan

Demo

Requirements

  • Swift 4.2
  • iOS 10.0+

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects.

To integrate MBDocCapture into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
pod 'MBDocCapture', '>= 0.9'
end

Then, run the following command:

$ pod install

Usage

Swift

  1. Make sure that your view controller conforms to the ImageScannerControllerDelegate protocol:
class YourViewController: UIViewController, ImageScannerControllerDelegate {
// YourViewController code here
}
  1. Implement the delegate functions inside your view controller:
/// Tells the delegate that the user scanned a document.
///
/// - Parameters:
///   - scanner: The scanner controller object managing the scanning interface.
///   - results: The results of the user scanning with the camera.
/// - Discussion: Your delegate's implementation of this method should dismiss the image scanner controller.
func imageScannerController(_ scanner: ImageScannerController, didFinishScanningWithResults results: ImageScannerResults) {
    scanner.dismiss()
}

/// Tells the delegate that the user scanned a document.
///
/// - Parameters:
///   - scanner: The scanner controller object managing the scanning interface.
///   - page1Results: The results of the user scanning page 1.
///   - page2Results: The results of the user scanning page 2.
/// - Discussion: Your delegate's implementation of this method should dismiss the image scanner controller.
func imageScannerController(_ scanner: ImageScannerController, didFinishScanningWithPage1Results page1Results: ImageScannerResults, andPage2Results page2Results: ImageScannerResults) {
    scanner.dismiss()
}

/// Tells the delegate that the user cancelled the scan operation.
///
/// - Parameters:
///   - scanner: The scanner controller object managing the scanning interface.
/// - Discussion: Your delegate's implementation of this method should dismiss the image scanner controller.
func imageScannerControllerDidCancel(_ scanner: ImageScannerController) {
    scanner.dismiss()
}

/// Tells the delegate that an error occured during the user's scanning experience.
///
/// - Parameters:
///   - scanner: The scanner controller object managing the scanning interface.
///   - error: The error that occured.
func imageScannerController(_ scanner: ImageScannerController, didFailWithError error: Error) {
    scanner.dismiss()
}
  1. Finally, create and present a ImageScannerController instance somewhere within your view controller:
    let scannerViewController = ImageScannerController(delegate: self)
    //scannerViewController.shouldScanTwoFaces = false // Use this to scan the front and the back of a document 
    present(scannerViewController, animated: true)

License

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

Support

If this project helped you, buy me coffee โ˜•

paypal

mbdoccapture's People

Contributors

imhdi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.