renderFirstPage method

  1. @override
Future<Uint8List?> renderFirstPage(
  1. String pubUrl, {
  2. int maxWidth = 600,
  3. int maxHeight = 800,
})
override

Renders the first page of a PDF publication as a JPEG image. Returns the image bytes, or null if rendering fails. pubUrl is the file path or URL to the PDF. maxWidth and maxHeight constrain the output dimensions.

Implementation

@override
Future<Uint8List?> renderFirstPage(
  String pubUrl, {
  int maxWidth = 600,
  int maxHeight = 800,
}) async {
  final result = await methodChannel.invokeMethod<Uint8List>(
    'renderFirstPage',
    [pubUrl, maxWidth, maxHeight],
  );
  return result;
}