render static method

Future<PdfPageImage?> render(
  1. String filePath,
  2. int pageNumber, {
  3. int? x,
  4. int? y,
  5. int? width,
  6. int? height,
  7. double? fullWidth,
  8. double? fullHeight,
})
override

Implementation

static Future<PdfPageImage?> render(String filePath, int pageNumber,
  { int? x, int? y, int? width, int? height,
    double? fullWidth, double? fullHeight}) async {
  final doc = await PdfDocument.openFile(filePath);
  if (doc == null) return null;
  final page = await (doc.getPage(pageNumber) as FutureOr<PdfPage>);
  final image = await page.render(
    x: x, y: y,
    width: width,
    height: height,
    fullWidth: fullWidth, fullHeight: fullHeight);
  doc.dispose();
  return image;
}