renderFirstPage method
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;
}