convertToPDFImage static method

Future<ImagePDF?> convertToPDFImage(
  1. PdfDocument document
)

Implementation

static Future<ImagePDF?> convertToPDFImage(PdfDocument document) async {
  img.Image? image = await _createFullImageFromPDF(document);
  if (image == null) {
    return null;
  }

  File? file = await _imageToFile(image);
  if (file == null) {
    return null;
  }

  return ImagePDF(
    document: document,
    file: file,
    image: image,
  );
}