Customize default annotation properties using setAnnotationConfigurations on your PspdfkitWidgetController:
// Call within onPdfDocumentLoaded
_controller?.setAnnotationConfigurations({
AnnotationTool.inkPen: InkAnnotationConfiguration(
color: Colors.purple,
thickness: 2.0,
),
AnnotationTool.highlight: MarkupAnnotationConfiguration(
color: Colors.yellow.withOpacity(0.4),
),
});InkAnnotationConfiguration: For Pen, Highlighter, Magic Ink, Eraser, SignatureLineAnnotationConfiguration: For Line, Arrow, Polyline, Distance MeasurementFreeTextAnnotationConfiguration: For Free Text, CalloutShapeAnnotationConfiguration: For Square, Circle, Polygon, Area MeasurementMarkupAnnotationConfiguration: For Highlight, Underline, Strikeout, SquigglyStampAnnotationConfiguration: For Stamp and Image annotationsReductionAnnotationConfigurations: For Redaction toolsNoteAnnotationConfiguration: For Note annotations
Signatures require specific implementations:
- iOS: Uses
SignatureHelperclass. When a signature saving strategy is specified, PSPDFKit sets upPSPDFKeychainSignatureStoreautomatically. - Android: Implement
DatabaseSignatureStoragein yourFlutterPdfActivitywherePdfFragmentis used.
- iOS:
blendMode,borderStyle - Android:
availableColors,min/maxThickness,min/maxAlpha,enableColorPicker, etc.
For details, see AnnotationConfiguration.