public getText() as String
Extracts Unicode text in content-stream order, with geometric line and space separation. Non-empty lines end in '\n'; pages without text return an empty String. Images are not OCRed. PDF does not prescribe a unique plain-text layout, so whitespace can differ from other PDF readers. Unmapped character codes are represented by the Unicode replacement character U+FFFD. Page/Form bounds are respected, but general vector clipping, visibility layers and text rendering modes are not rendered.
The page's extracted text.
print(document.pages[0].getText())