docs_auto_sign
A Flutter package that automatically detects signature fields in a PDF and stamps a PNG signature image onto them.
Features
- 📄 Automatically finds target words (e.g.
signature,sign) in a PDF - 🖊️ Stamps a PNG signature image above each found word
- 📦 Returns signed PDF as
Uint8List - ⚙️ Fully customizable — target words, signature size
Installation
Add this to your pubspec.yaml:
dependencies:
docs_auto_sign: ^0.0.1
Then run:
flutter pub get
Usage
import 'package:docs_auto_sign/docs_auto_sign.dart';
final result = await AutoSignService.applySignatureToPdf(
originalPdfFile: myPdfFile, // File
signatureBytes: mySignaturePng, // Uint8List (PNG)
targetWords: ['signature', 'sign'], // words to find
);
print('Total signatures added: ${result.totalSignaturesAdded}');
print('Pages modified: ${result.pagesModified}');
// result.signedPdfBytes → Uint8List (signed PDF)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
originalPdfFile |
File |
✅ | The original PDF file |
signatureBytes |
Uint8List |
✅ | PNG signature image bytes |
targetWords |
List<String> |
✅ | Words to search and sign |
signatureWidth |
double |
❌ | Default: 120.0 |
signatureHeight |
double |
❌ | Default: 50.0 |
Result
| Property | Type | Description |
|---|---|---|
signedPdfBytes |
Uint8List |
Signed PDF bytes |
totalSignaturesAdded |
int |
Total signatures stamped |
pagesModified |
List<int> |
Pages that were modified |
License
MIT