PdfImage.fromImage constructor

PdfImage.fromImage(
  1. PdfDocument pdfDocument, {
  2. required Image image,
  3. PdfImageOrientation orientation = PdfImageOrientation.topLeft,
})

Create an image from an im.Image object

Implementation

factory PdfImage.fromImage(
  PdfDocument pdfDocument, {
  required im.Image image,
  PdfImageOrientation orientation = PdfImageOrientation.topLeft,
}) {
  final raster = PdfRasterBase.fromImage(image);
  return PdfImage(
    pdfDocument,
    image: raster.pixels,
    width: raster.width,
    height: raster.height,
    alpha: raster.alpha,
    orientation: orientation,
  );
}