CPDFImageAnnotation.fromPath constructor
CPDFImageAnnotation.fromPath({})
Creates an image annotation from a local file path.
Use this when the image already exists on the device file system, such as a cached export or a user-selected file.
Example:
final annotation = CPDFImageAnnotation.fromPath(
page: 1,
rect: const CPDFRectF(
left: 60,
top: 100,
right: 240,
bottom: 280,
),
filePath: '/data/user/0/com.example.app/cache/signature.png',
);
Implementation
factory CPDFImageAnnotation.fromPath({
String? title,
String? content,
DateTime? createDate,
required int page,
String uuid = '',
required CPDFRectF rect,
required String filePath,
}) {
return CPDFImageAnnotation(
title: title ?? '',
content: content ?? '',
createDate: createDate,
page: page,
uuid: uuid,
rect: rect,
imageData: CPDFImageData.fromPath(filePath),
);
}