buildImage method

  1. @override
PdfImage buildImage(
  1. Context context, {
  2. int? width,
  3. int? height,
})
override

Implementation

@override
PdfImage buildImage(Context context, {int? width, int? height}) {
  if (width == null) {
    return PdfImage.fromImage(context.document, image: _image);
  }

  final resized = im.copyResize(_image, width: width);
  return PdfImage.fromImage(context.document, image: resized);
}