pixel_to_pdf 1.0.0 copy "pixel_to_pdf: ^1.0.0" to clipboard
pixel_to_pdf: ^1.0.0 copied to clipboard

A comprehensive attachment picker and document scanner for Flutter. Supports camera, gallery, file picking, and native document scanning with cropping.

pixel_to_pdf #

A comprehensive attachment picker and document scanner for Flutter. Supports camera, gallery, file picking, and native document scanning with cropping.

Features #

  • Document Scanning: Native document scanning with automatic edge detection and cropping (via Google ML Kit).
  • Camera: Take photos directly from the app.
  • Gallery Picker: Pick images from the gallery (single or multi-select).
  • File Picker: Pick any file from the device storage.
  • Image Cropping: Integrated image cropping using image_cropper.
  • PDF Generation: Automatically converts scanned documents into PDF files.

Installation #

Add pixel_to_pdf to your pubspec.yaml:

dependencies:
  pixel_to_pdf: ^1.0.0

Android Setup #

  1. Min SDK: Requires at least API 21.
  2. Permissions: Add this to your AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
  1. Image Cropper: To support image cropping, you must register the UCropActivity in your AndroidManifest.xml:
<activity
    android:name="com.yalantis.ucrop.UCropActivity"
    android:screenOrientation="portrait"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

Note

The package handles FileProvider internally using the authority ${applicationId}.pixel_to_pdf.fileprovider. No manual FileProvider setup is required unless there is a naming conflict.

iOS Setup #

  1. Deployment Target: Requires at least iOS 14.0.
  2. Permissions: Add the following keys to your Info.plist:
<key>NSCameraUsageDescription</key>
<string>We need access to your camera to scan documents and take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photo library to select images.</string>

Usage #

import 'package:pixel_to_pdf/pixel_to_pdf.dart';

final results = await PixelToPdf.show(
  context,
  config: AttachmentConfig(
    uiStyle: AttachmentUIStyle.bottomSheet,
    features: [
      AttachmentFeature.scanDoc,
      AttachmentFeature.takePhoto,
      AttachmentFeature.fromGallery,
      AttachmentFeature.fromFiles,
    ],
  ),
);

Local Development #

To test this package locally:

dependencies:
  pixel_to_pdf:
    path: ../pixel_to_pdf

Publishing #

  1. Check for issues: flutter pub publish --dry-run
  2. Publish: flutter pub publish
8
likes
0
points
236
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive attachment picker and document scanner for Flutter. Supports camera, gallery, file picking, and native document scanning with cropping.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, image, image_cropper, path, path_provider, pdf

More

Packages that depend on pixel_to_pdf

Packages that implement pixel_to_pdf