Skip to content

Commit

Permalink
Merge pull request #114 from gbrlmza/master
Browse files Browse the repository at this point in the history
Fix on Page->getText() and Page->getTextArray()
  • Loading branch information
smalot authored Nov 5, 2016
2 parents 34fb40f + 688e402 commit 5c1eaff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Smalot/PdfParser/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Smalot\PdfParser\Element\ElementArray;
use Smalot\PdfParser\Element\ElementMissing;
use Smalot\PdfParser\Element\ElementXRef;
use Smalot\PdfParser\Element\ElementNull;

/**
* Class Page
Expand Down Expand Up @@ -185,6 +186,8 @@ public function getText(Page $page = null)

if ($contents instanceof ElementMissing) {
return '';
} elseif ($contents instanceof ElementNull) {
return '';
} elseif ($contents instanceof Object) {
$elements = $contents->getHeader()->getElements();

Expand Down Expand Up @@ -231,6 +234,8 @@ public function getTextArray(Page $page = null)

if ($contents instanceof ElementMissing) {
return array();
} elseif ($contents instanceof ElementNull) {
return array();
} elseif ($contents instanceof Object) {
$elements = $contents->getHeader()->getElements();

Expand Down

0 comments on commit 5c1eaff

Please sign in to comment.