CPDFWatermark class

Constructors

CPDFWatermark({required CPDFWatermarkType type, required List<int> pages, int index = -1, String textContent = '', String imagePath = '', bool isImageExported = false, Color textColor = Colors.black, int fontSize = 24, double scale = 1.0, double rotation = 45, double opacity = 1, CPDFWatermarkVerticalAlignment verticalAlignment = CPDFWatermarkVerticalAlignment.center, CPDFWatermarkHorizontalAlignment horizontalAlignment = CPDFWatermarkHorizontalAlignment.center, double verticalOffset = 0, double horizontalOffset = 0, bool isFront = true, bool isTilePage = false, double horizontalSpacing = 0, double verticalSpacing = 0})
const
CPDFWatermark.fromJson(Map<String, dynamic> json)
factory
CPDFWatermark.image({required String imagePath, required List<int> pages, int index = -1, double scale = 1.0, double rotation = 45, double opacity = 1, CPDFWatermarkVerticalAlignment verticalAlignment = CPDFWatermarkVerticalAlignment.center, CPDFWatermarkHorizontalAlignment horizontalAlignment = CPDFWatermarkHorizontalAlignment.center, double verticalOffset = 0, double horizontalOffset = 0, bool isFront = true, bool isTilePage = false, double horizontalSpacing = 0, double verticalSpacing = 0, bool isImageExported = false})
Image watermark constructor
CPDFWatermark.text({required String textContent, required List<int> pages, int index = -1, Color textColor = Colors.black, int fontSize = 24, double scale = 1.0, double rotation = 45, double opacity = 1, CPDFWatermarkVerticalAlignment verticalAlignment = CPDFWatermarkVerticalAlignment.center, CPDFWatermarkHorizontalAlignment horizontalAlignment = CPDFWatermarkHorizontalAlignment.center, double verticalOffset = 0, double horizontalOffset = 0, bool isFront = true, bool isTilePage = false, double horizontalSpacing = 0, double verticalSpacing = 0})
Text watermark constructor

Properties

fontSize int
final
hashCode int
The hash code for this object.
no setterinherited
horizontalAlignment CPDFWatermarkHorizontalAlignment
Horizontal alignment of the watermark, default is center alignment
final
horizontalOffset double
Horizontal offset for watermark position
final
horizontalSpacing double
Set the horizontal spacing for tiled watermarks
final
imagePath String
Image path for image-type watermark.
final
index int
Watermark index in the current document watermark list.
final
isFront bool
Position the watermark in front of the content
final
isImageExported bool
Whether imagePath was exported from an existing image watermark.
final
isTilePage bool
Enable watermark tiling
final
opacity double
Watermark opacity, default is 1.0, range is 0.0 to 1.0
final
pages List<int>
Pages to add the watermark to, e.g., "1,2,3,4,5"
final
rotation double
Watermark rotation angle, default is 45°
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
Scaling factor, default is 1.0
final
textColor Color
final
textContent String
final
type CPDFWatermarkType
final
verticalAlignment CPDFWatermarkVerticalAlignment
Vertical alignment of the watermark, default is vertical center alignment
final
verticalOffset double
Vertical offset for watermark position
final
verticalSpacing double
Set the vertical spacing for tiled watermarks
final

Methods

copyWith({int? index, CPDFWatermarkType? type, String? textContent, String? imagePath, bool? isImageExported, Color? textColor, int? fontSize, double? scale, double? rotation, double? opacity, CPDFWatermarkVerticalAlignment? verticalAlignment, CPDFWatermarkHorizontalAlignment? horizontalAlignment, double? verticalOffset, double? horizontalOffset, List<int>? pages, bool? isFront, bool? isTilePage, double? horizontalSpacing, double? verticalSpacing}) CPDFWatermark
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited
validateForCreate() String?
Validates the watermark before creating it in a document.
validateForUpdate() String?
Validates the watermark before updating it in a document.

Operators

operator ==(Object other) bool
The equality operator.
inherited