getAllText method

Future<String> getAllText()

Retrieves all text on the current page.

Returns an empty string if the page has no text content.

example:

final int pageIndex = await controller.getCurrentPageIndex();
final CPDFPage page = controller.document.pageAtIndex(pageIndex);
final String text = await page.getAllText();
print(text);

Since v2.6.8

Implementation

Future<String> getAllText() async {
  final result = await _channel.invokeMethod('get_page_text', {
    'page_index': pageIndex,
  });
  return result ?? '';
}