raster static method

Stream<PdfRaster> raster(
  1. Uint8List document, {
  2. List<int>? pages,
  3. double dpi = PdfPageFormat.inch,
})

Convert a PDF to a list of images.

await for (final page in Printing.raster(content)) {
  final image = page.asImage();
}

This is not supported on all platforms. Check the result of info to find at runtime if this feature is available or not.

Implementation

static Stream<PdfRaster> raster(
  Uint8List document, {
  List<int>? pages,
  double dpi = PdfPageFormat.inch,
}) {
  assert(dpi > 0);

  return PrintingPlatform.instance.raster(document, pages, dpi);
}