get method

Future<PDFPage> get({
  1. int page = 1,
  2. dynamic onZoomChanged(
    1. double
    )?,
  3. int? zoomSteps,
  4. double? minScale,
  5. double? maxScale,
  6. double? panLimit,
})

Load specific page

page defaults to 1 and must be equal or above it

Implementation

Future<PDFPage> get({
  int page = 1,
  final Function(double)? onZoomChanged,
  final int? zoomSteps,
  final double? minScale,
  final double? maxScale,
  final double? panLimit,
}) async {
  assert(page > 0);
  if (_preloaded && _pages.isNotEmpty) return _pages[page - 1];
  final data = await _channel
      .invokeMethod('getPage', {'filePath': _filePath, 'pageNumber': page});
  return PDFPage(
    data as String?,
    page,
    onZoomChanged: onZoomChanged,
    zoomSteps: zoomSteps ?? 3,
    minScale: minScale ?? 1.0,
    maxScale: maxScale ?? 5.0,
    panLimit: panLimit ?? 1.0,
  );
}