toPdfWidget method

Future<Image> toPdfWidget()

Converts the Image to a pw.Image.

Implementation

Future<pw.Image> toPdfWidget() async => pw.Image(
      await image.toPdfImageProvider(),
      width: width,
      height: height,
      fit: fit?.toPdfBoxFit() ?? pw.BoxFit.contain,
      alignment: (alignment as Alignment).toPdfAlignment(),
    );