Smalot\PdfParser\Document::getText PHP Method

getText() public method

public getText ( Page $page = null ) : string
$page Page
return string
    public function getText(Page $page = null)
    {
        $texts = array();
        $pages = $this->getPages();
        foreach ($pages as $index => $page) {
            if ($text = trim($page->getText())) {
                $texts[] = $text;
            }
        }
        return implode("\n\n", $texts);
    }