PdfTextExtractor constructor

PdfTextExtractor(
  1. PdfDocument document
)

Initialize a new instance of the PdfTextExtractor class from the instance of PdfDocument

//Load an exisiting PDF document.
PdfDocument document = PdfDocument.fromBase64String(pdfData);
//Extract text from all pages
String text = PdfTextExtractor(document).extractText();
//Dispose the document.
document.dispose();

Implementation

PdfTextExtractor(PdfDocument document) {
  if (!PdfDocumentHelper.getHelper(document).isLoadedDocument) {
    ArgumentError.value(document, 'document',
        'document instance is not a loaded PDF document');
  }
  _document = document;
  _initialize();
}