quickcapture 1.0.11
quickcapture: ^1.0.11 copied to clipboard
QuickCapture AI Based Mobile Document Scanning plugin for Flutter From Extrieve.
Quickcapture Flutter Plugin #
Extrieve Technologies - Your Expert in Document Management & AI Solutions
The Quickcapture Flutter plugin enables document scanning & imaging using mobile devices. It can integrates seamlessly with mobile applications, providing high-quality document capture, compression, optimization, and conversion into PDF and TIFF formats.
Key Features #
- High-Quality Capture: Optimized focus control for document scanning.
- Compression & Optimization: Generate small, high-quality outputs for fast uploads.
- DPI and Layout Control: Adjust DPI, layouts, and output sizes for PDF/TIFF.
- Developer-Friendly: Easy integration into your Flutter applications.
- Multi-Format Output: Supports output in both PDF and TIFF formats.
Note: It's not "just" a scanning SDK. It's a document scanning SDK built with Best Quality, Highest Possible Compression, and Image Optimization on in mind that works fully offline & on device.
Compatibility #
- Java: Requires Java 17 or later.
- Android:
- Minimum SDK: API 21
- Target SDK: API 35
- Compiled SDK: API 34
- iOS: Requires iOS 11 or later.
Other Available Platform Options #
API Methods #
1. activateLicense #
Activates the license for the Quickcapture plugin.
Future<bool?> activateLicense(String,String);
Example
Future<bool?> activateLicense({
required String android,
required String ios,
});
// Parameters
// - `android`: License string for Android.
// - `ios`: License string for iOS.
// Return Value
// - `true` if the license was successfully activated.
// - `false` or `null` otherwise.
2. initialize #
Initializes the Quickcapture plugin. This is required before calling other methods.
Future<String?> initialize();
Example
@override
void initState() {
super.initState();
_quickCapturePlugin.initialize();
}
3. startCapture #
Starts the document capture process and returns the details of the captured images.
_quickCapturePlugin.startCapture();
Example
Future<void> startCapture() async {
String? response = await _quickCapturePlugin.startCapture();
if (response != null) {
Map<String, dynamic> jsonResponse = jsonDecode(response);
List<String> capturedImages = List<String>.from(jsonResponse['fileCollection']);
print("Captured Images: $capturedImages");
} else {
print("Capture failed or cancelled.");
}
}
4. buildPDFForLastCapture #
Generates a PDF file from the images captured in the last session.
Future<String?> buildPDFForLastCapture();
Example
Future<void> buildPDF() async {
String? pdfFilePath = await _quickCapturePlugin.buildPDFForLastCapture();
if (pdfFilePath != null) {
print("PDF generated at: $pdfFilePath");
} else {
print("Failed to generate PDF.");
}
}
5. buildTIFFForLastCapture #
Generates a TIFF file from the images captured in the last session.
_quickCapturePlugin.buildTIFFForLastCapture();
Example
Future<void> buildTIFF() async {
String? tiffPath = await _quickCapturePlugin.buildTIFFForLastCapture();
if (tiffPath != null) {
print("TIFF generated at: $tiffPath");
} else {
print("Failed to generate TIFF.");
}
}
6. compressToJPEG #
Generates an optimized and compressed output image path in JPEG format.
Future<String?> compressToJPEG(String imagePath);
Example
Future<void> compressImage() async {
String imagePath = "path/to/image.jpg";
String? compressedImagePath = await _quickCapturePlugin.compressToJPEG(imagePath);
if (compressedImagePath != null) {
print("Compressed image at: $compressedImagePath");
} else {
print("Failed to compress image.");
}
}
7. setCustomLayout #
Customizes layout dimensions, such as setting specific dimensions like 200x300 pixels, which can impact the quality of the output image.
Future<bool?> setCustomLayout(int customWidth, int customHeight);
Example
bool? isCustomLayoutSet = await _quickCapturePlugin.setCustomLayout(500, 900); // in pixels
if (isCustomLayoutSet == true) {
print("Custom layout set successfully.");
}
Configurations #
The Config class provides detailed control over the image and capture settings.
1. Image Configuration #
Use ConfigImage to manage image-specific settings.
| Property | Description |
|---|---|
ImageQuality |
Quality of the output image (e.g., photoQuality, documentQuality, compressedDocument). |
DPI |
DPI of the output (e.g., 150, 200, 300). |
LayoutType |
Document layout (e.g., A3, A4, A5). |
ResizeMode |
Strategy for resizing the image: |
- preserveAspectOnly (default, recommended): Maintains aspect ratio while scaling. |
|
- stretchToExactSize: Forces exact width and height, may distort. |
|
- fitWithAspect: Fits within dimensions, maintaining aspect ratio with padding. |
Recommended Settings:
- ImageQuality:
documentQuality- DPI:
150or200- LayoutType:
A4- ResizeMode:
preserveAspectOnly
Example
Quickcapture _quickcapturePlugin = Quickcapture();
Config imgConfig = _quickcapturePlugin.config.image;
imgConfig.setImageQuality(ImageQuality.documentQuality);
imgConfig.setDPI(DPI.dpi200);
imgConfig.setLayoutType(LayoutType.A4);
imgConfig.setResizeMode(ResizeMode.preserveAspectOnly);
2. Capture Configuration #
Use ConfigCapture to manage capture-specific settings.
| Property | Description |
|---|---|
captureSound |
Enables or disables capture sound (true/false). |
enableFlash |
Enables or disables flash during capture (true/false). |
showCaptureCountAndLimit |
Displays capture count and limit (true/false). |
colorMode |
Sets the color mode (rgb, grayScale). |
maxPage |
Limits the number of pages to capture. (0 = unlimited). |
cameraToggle |
Switch between front/back cameras (enableBackDefault, enableFrontDefault). |
bottomStampData |
BottomStampData - This configuration will automatically print the specified text at the bottom of the captured image with correct alignment, font size and DPI. This also supports placeholders, such as {DATETIME}, which will be replaced with the current date and time from the device at the time of stamping. $ - for new line print.This will only support for captured with SDK camera image. |
Example
Quickcapture _quickcapturePlugin = Quickcapture();
Config captureConfig = _quickcapturePlugin.config.capture;
captureConfig.enableFlash = true;
captureConfig.captureSound = false;
captureConfig.maxPage = 2;
captureConfig.cameraToggle = CameraToggleType.enableBackDefault;
captureConfig.bottomStampData = "Scanned on {DATETIME} $ Scanned User ID :123456";
Method Summary #
| Method | Description | Return Value |
|---|---|---|
activateLicense |
Activates the plugin license. | true on success. |
initialize |
Initializes the plugin. | void. |
startCapture |
Starts document capture. | JSON with capture details. |
buildPDFForLastCapture |
Generates a PDF from the last capture. | File path of the generated PDF. |
buildTIFFForLastCapture |
Generates a TIFF from the last capture. | File path of the generated TIFF. |
setCustomLayout |
Sets custom layout dimensions. | true on success. |
compressToJPEG |
Compresses and optimizes an image. | File path of the JPEG image. |
Notes #
- Initialization: Always call
initializebefore using the plugin. - License Activation: Ensure the license is activated before use for all features.
For more information, refer to the Quickcapture documentation.