A document scanner + PDF generator plugin for flutter
document_scanner_flutter:
git:
url: https://github.com/MyCareRecords/document_scanner_flutter
ref: master
And add pod 'WeScan', :path => '.symlinks/plugins/document_scanner_flutter/ios/WeScan-3.0.0'
in your Podfile.
Your Podfile will look like this now -
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'WeScan', :path => '.symlinks/plugins/document_scanner_flutter/ios/WeScan-3.0.0'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
Finally, run flutter clean && flutter pub get
Then navigate to the ios folder run rm Podfile.lock && rm -rf .symlinks Pods && pod install --repo-update
try {
File scannedDoc = await DocumentScannerFlutter.launch();
// `scannedDoc` will be the image file scanned from scanner
} on PlatformException {
// 'Failed to get document path or operation cancelled!';
}
try {
File scannedDoc = await DocumentScannerFlutter.launch(source: ScannerFileSource.CAMERA); // Or ScannerFileSource.GALLERY
// `scannedDoc` will be the image file scanned from scanner
} on PlatformException {
// 'Failed to get document path or operation cancelled!';
}
try {
File scannedDoc = await DocumentScannerFlutter.launchForPdf(source: ScannerFileSource.CAMERA); // Or ScannerFileSource.GALLERY
// `scannedDoc` will be the PDF file generated from scanner
} on PlatformException {
// 'Failed to get document path or operation cancelled!';
}
try {
// Other Android Scanner labels customization
var androidLabelsConfigs = {
ScannerConfigsAndroid.ANDROID_NEXT_BUTTON_TITLE : "Next Step",
ScannerConfigsAndroid.ANDROID_SAVE_BUTTON_TITLE: "Save It",
ScannerConfigsAndroid.ANDROID_ROTATE_LEFT_TITLE: "Turn it left",
ScannerConfigsAndroid.ANDROID_ROTATE_RIGHT_TITLE: "Turn it right",
ScannerConfigsAndroid.ANDROID_ORIGINAL_TITLE: "Original",
ScannerConfigsAndroid.ANDROID_BMW_TITLE: "B & W"
}
File scannedDoc = await DocumentScannerFlutter.launchForPdf(source: ScannerFileSource.CAMERA,androidConfigs: androidLabelsConfigs);
// `scannedDoc` will be the PDF file generated from scanner
} on PlatformException {
// 'Failed to get document path or operation cancelled!';
}