CPDFExtractImageResult.fromJson constructor

CPDFExtractImageResult.fromJson(
  1. Map<String, dynamic> json
)

Creates an image extraction result from native JSON data.

Implementation

factory CPDFExtractImageResult.fromJson(Map<String, dynamic> json) {
  final rawPaths = json['image_paths'];
  return CPDFExtractImageResult(
    success: json['success'] == true,
    count: (json['count'] as num?)?.toInt() ?? 0,
    directoryPath: json['directory_path'] as String? ?? '',
    imagePaths: rawPaths is List ? rawPaths.whereType<String>().toList() : [],
  );
}