CPDFBackground.fromJson constructor
CPDFBackground.fromJson(
- Map<String, dynamic> json
)
Implementation
factory CPDFBackground.fromJson(Map<String, dynamic> json) {
return CPDFBackground(
pages: _pagesFromString(json['pages'] as String? ?? ''),
type: CPDFBackgroundType.fromValue(json['type']),
color: _color(json['color']),
imagePath: _nonEmptyString(json['image_path']),
opacity: _number(json['opacity'], 1),
scale: _number(json['scale'], 1),
rotation: _number(json['rotation'], 0),
horizontalAlignment: CPDFBackgroundHorizontalAlignment.fromValue(
json['horizontal_alignment'],
),
verticalAlignment: CPDFBackgroundVerticalAlignment.fromValue(
json['vertical_alignment'],
),
horizontalOffset: _number(json['horizontal_offset'], 0),
verticalOffset: _number(json['vertical_offset'], 0),
allowView: json['allow_view'] is bool ? json['allow_view'] as bool : true,
allowPrint:
json['allow_print'] is bool ? json['allow_print'] as bool : true,
);
}