패키지, 저장소 및 앱 카테고리 검색

flutter_doc_scanner 표지
패키지 상세v0.0.21

flutter_doc_scanner

ML Kit 문서 스캐너 API 및 VisionKit을 사용하여 안드로이드 및 iOS에서 문서 스캔용 플러터 플러그인입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.7만
좋아요
166
Pub 점수
140

패키지 설치

flutter pub add flutter_doc_scanner

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Google의 ML Kit 문서 스캐너 API와 Apple의 VisionKit을 활용하여 Android 및 iOS에서 문서 스캔을 가능하게 하는 Flutter 플러그인입니다. 이미지에서 문서 가장자리를 캡처하고 감지하는 원활한 방법을 제공하며, 자동으로 자르고 증강된 스캔 문서를 제공합니다. Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 문서 디지털화가 필요한 크로스플랫폼 애플리케이션에 적합합니다. 통합의 용이성을 고려해 설계되어, 깊은 네이티브 코드 지식 없이도 스마트한 문서 스캔 기능을 쉽게 추가할 수 있습니다.

사용 사례

  • 모바일 앱에서의 문서 디지털화
  • 자동 청구서 및 영수증 스캔
  • 신원 확인이 포함된 온보딩 워크플로
  • 스캔된 문서에서 PDF 생성
  • 모바일 뱅킹 및 양식 처리

주요 기능

  • 정확한 감지에 ML Kit 및 VisionKit 사용
  • 모든 주요 OS에서의 크로스 플랫폼 지원
  • 이미지 캡처 및 처리를 위한 간단한 API
  • 자동 에지 감지 및 자르기
  • Android 및 iOS를 모두 네이티브 성능으로 지원

적합한 대상

  • 문서가 많은 앱을 개발하는 개발자
  • 빠른 온보딩이 필요한 스타트업
  • OCR 준비된 스캔이 필요한 앱
  • 플러터를 사용하는 크로스 플랫폼 팀
  • 기업들이 서류 작업 자동화

고려 사항

  • 모바일 장치에서 카메라 권한이 필요합니다
  • 오래된 기기에서는 성능이 다를 수 있습니다
  • 웹 지원은 브라우저 기능에 따라 달라집니다
  • 스캔 UI의 사용자 정의 제한
  • 외부 SDK(ML Kit, VisionKit)에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

flutter_doc_scanner

A Flutter plugin for document scanning on Android, iOS, and Web using ML Kit Document Scanner API and VisionKit.

pub package

Example

Check out the example directory for a sample Flutter app using flutter_doc_scanner.

Document Scanner Demo

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3
Screenshot 4 Screenshot 5 Screenshot 6

Features

  • High-quality and consistent user interface for digitizing physical documents.
  • Accurate document detection with precise corner and edge detection for optimal scanning results.
  • Flexible functionality allows users to crop scanned documents, apply filters, remove fingers, remove stains and other blemishes.
  • On-device processing helps preserve privacy.
  • Support for sending digitized files in PDF and JPEG formats back to your app.
  • Ability to set a scan page limit.
  • Support for image(png,jpeg) format and PDF has been added through various methods.
  • Fast single-picture scanning mode via useAutomaticSinglePictureProcessing for quick one-document captures.

Installation

To use this plugin, add flutter_doc_scanner as a dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter
  flutter_doc_scanner: ^0.0.21

Got it! Here's a more detailed explanation:

Usage

Use the following function for document scanning on Android and iOS:

  Future<void> scanDocument() async {
  //by default way they fetch pdf for android and png for iOS
  dynamic scannedDocuments;
  try {
    scannedDocuments = await FlutterDocScanner().getScanDocuments(page: 3) ??
        'Unknown platform documents';
  } on PlatformException {
    scannedDocuments = 'Failed to get scanned documents.';
  }
  print(scannedDocuments.toString());
}

Note-: If you want to obtain only a PDF scanned document, call getScannedDocumentAsPdf(). Similarly, if you want to get a scanned document in image format, use getScannedDocumentAsImages().

Android result payloads
  • getScanDocuments / getScannedDocumentAsPdf: returns a map with pdfUri and pageCount.
  • getScannedDocumentAsImages / getScanDocumentsUri: returns a map with images (list of page URIs) and count (also exposed via legacy Uri / Count keys for backwards compatibility).

Project Setup

Follow the steps below to set up your Flutter project on Android, iOS, and Web.

Android
Minimum Version Configuration

Ensure you meet the minimum version requirements to run the application on Android devices. In the android/app/build.gradle file, verify that minSdkVersion is at least 21. This setting specifies the minimum Android API level required to run your app, ensuring compatibility with a wide range of Android devices.

android {
    ...
    defaultConfig {
        ...
        minSdkVersion 21
        ...
    }
    ...
}
iOS
Minimum Version Configuration

Ensure you meet the minimum version requirements to run the application on iOS devices. In the ios/Podfile file, make sure the iOS platform version is at least 13.0. This setting specifies the minimum iOS version required to run your app, ensuring compatibility with a wide range of iOS devices.

platform :ios, '13.0'
Permission Configuration
  1. Add a String property to the app's Info.plist file with the key NSCameraUsageDescription and the value as the description for why your app needs camera access. This step is required by Apple to explain to users why the app needs access to the camera, and it's crucial for App Store approval.
  <key>NSCameraUsageDescription</key>
  <string>Camera Permission Description</string>
  1. The permission_handler dependency used by flutter_doc_scanner uses macros to control whether a permission is enabled. To enable camera permission, add the following to your Podfile file. This step ensures that your app can request and handle camera permissions on iOS devices:
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      ... # Here are some configurations automatically generated by flutter

      # Start of the permission_handler configuration
      target.build_configurations.each do |config|

        # You can enable the permissions needed here. For example, to enable camera
        # permission, just remove the `#` character in front so it looks like this:
        #
        # ## dart: PermissionGroup.camera
        # 'PERMISSION_CAMERA=1'
        #
        #  Preprocessor definitions can be found at: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
          '$(inherited)',

          ## dart: PermissionGroup.camera
          'PERMISSION_CAMERA=1',
        ]

      end
      # End of the permission_handler configuration
    end
  end
Web

Currently, we have removed web support for this library. For document scanning on the web, you can use the following library: flutter_doc_scanner_web.

Issues and Feedback

Please file issues to send feedback or report a bug. Thank you!

License

The MIT License (MIT) Copyright (c) 2024 Shirsh Shukla

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.2

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.