pdf_stamp_editor 0.6.0
pdf_stamp_editor: ^0.6.0 copied to clipboard
PDF viewer with stamp overlays and native export layer (Android+iOS supported).
0.6.0 #
Bug Fixes #
- Text Stamp Color Export: Fixed issue where exported PDFs always showed text stamps in red color, regardless of the color set via API
- Dart serialization now correctly uses
TextStamp.color.valueinstead of hardcoded red - iOS native code now reads and applies the ARGB color value from the payload
- Android implementation was already correct and now receives proper color values
- Dart serialization now correctly uses
Backward Compatibility #
All changes are backward compatible. Existing code will continue to work without modification.
0.5.0 #
Features #
- Delete Button for Selected Stamps: Added visual delete button that appears on selected stamps
- New
DeleteButtonConfigclass for customizing delete button appearance - Button appears in the top-right corner of selected stamps
- Fully customizable: colors, size, icon, position, and elevation
- Can be disabled via
DeleteButtonConfig.disabled()
- New
API Changes #
SelectionConfig:- New optional parameter:
deleteButtonConfig(default:null- button not shown)
- New optional parameter:
- New class:
DeleteButtonConfig- Configuration for delete button styling
Backward Compatibility #
All changes are backward compatible. Existing code will continue to work without modification.
0.4.0 #
Features #
- Interaction Modes: Added
StampEditorModeto control tap behavior (none,text, orimage) - Precise Selection: Significantly improved hit-testing for stamps, especially for text stamps
- Long Press Control: Added
enableLongPressparameter (disabled by default)
Improvements #
- Refactored Gesture Handling: Internal cleanup for better performance and maintainability
API Changes #
PdfStampEditorPage:- New parameter:
mode(default:StampEditorMode.image) - New parameter:
enableLongPress(default:false)
- New parameter:
0.3.0 #
Features #
- Cross-Page Dragging: Stamps can now be dragged seamlessly across different PDF pages without interruption
Improvements #
- Code Cleanup: Removed unused export-related private functions from
PdfStampEditorPage
Backward Compatibility #
All changes are backward compatible. Existing code will continue to work without modification.
0.2.0 #
Features #
-
Configuration System: Added comprehensive configuration classes for customizing stamp behavior
TextStampConfig- Configure default text stamp text, font size, color, and weightImageStampConfig- Configure image stamp dimensions and aspect ratio behaviorSelectionConfig- Configure selection border styling (color and width)webSourceNameparameter - Configurable source name for web PDF viewer
-
Image Aspect Ratio Computation: Automatic height computation from actual PNG image dimensions
- When
ImageStampConfig.maintainAspectRatiois true andheightPtis null, height is computed from image dimensions - Image dimensions are cached for performance
- Falls back to default aspect ratio (0.35) if decoding fails
- When
Improvements #
- UI Cleanup: Removed enforced AppBar for cleaner PDF viewer experience
- Better UX: Removed error message when tapping without PNG selected (silent no-op)
- Layout Fixes: Widget now properly expands to maximum height without breaking layout constraints
- Code Quality: Removed excessive debug logging that spammed console output
API Changes #
-
New parameters added to
PdfStampEditorPage:textStampConfig(default:TextStampConfig())imageStampConfig(default:ImageStampConfig())selectionConfig(default:SelectionConfig())webSourceName(default:'stamped.pdf')
-
New configuration classes:
TextStampConfig- Configuration for text stamp creation and stylingImageStampConfig- Configuration for image stamp creationSelectionConfig- Configuration for selection visual styling
Backward Compatibility #
All changes are backward compatible. Existing code will continue to work with sensible defaults.
0.1.0 #
Initial release of the pdf_stamp_editor package - a Flutter package for viewing PDFs with stamp overlays and exporting stamped PDFs on mobile platforms.
Features #
- PDF Viewing: Display PDFs using the powerful
pdfrxviewer - Stamp Placement: Place and position image or text stamps on PDF pages
- Tap to place image stamps (requires PNG bytes)
- Long-press to place text stamps
- Interactive Editing: Drag, resize, rotate, and select stamps with gestures
- Enable/disable drag, resize, rotate, and selection via feature flags
- Keyboard shortcuts (Backspace/Delete) for deleting selected stamps
- Programmatic Control: Full API via
PdfStampEditorController- Add, update, remove stamps programmatically
- Selection management
- Change notifications via listeners
- PDF Export: Export stamped PDFs with vector-based stamping (mobile only)
- Native implementations: PdfBox-Android (Android), PDFKit (iOS)
- Stamps embedded as real PDF objects
- Web Support: View and place stamps on web (export disabled)
- Custom Stamp Rendering: Customize stamp appearance with
stampBuilder - Coordinate Conversion: Utilities for converting between PDF and screen coordinates
- Matrix Calculator: Calculate PDF transformation matrices for stamps
API #
PdfStampEditorPage- Main widget for PDF stamp editingPdfStampEditorController- Controller for programmatic stamp managementPdfStamp,ImageStamp,TextStamp- Stamp model classesPdfStampEditorExporter- Export engine for applying stamps to PDFsPdfCoordinateConverter- Utilities for coordinate conversionMatrixCalculator- Calculate PDF transformation matrices
Platform Support #
- ✅ Mobile (iOS/Android): Full support including export
- ⚠️ Web: View and place stamps only (export not supported)
- ❌ Desktop (Windows/macOS/Linux): Not currently supported
Example #
See the example/ directory for a complete working example demonstrating all features and APIs.