Skip to content

Commit

Permalink
fix xobject text extract
Browse files Browse the repository at this point in the history
  • Loading branch information
smalot committed Jan 29, 2014
1 parent e47bece commit 64fcda4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Smalot/PdfParser/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ public function getText(Page $page = null)
case 'TJ':
// Skip if not previously defined, should never happened.
if (is_null($current_font)) {
// Fallback
// TODO : Improve
$text .= $command[self::COMMAND][0][self::COMMAND];
continue;
}

Expand Down
5 changes: 3 additions & 2 deletions src/Smalot/PdfParser/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@ public function getXObject($id)
if (isset($xobjects[$id])) {
return $xobjects[$id];
} else {
$id = preg_replace('/[^0-9\.\-_]/', '', $id);
return null;
/*$id = preg_replace('/[^0-9\.\-_]/', '', $id);
if (isset($xobjects[$id])) {
return $xobjects[$id];
} else {
return null;
}
}*/
}
}

Expand Down

0 comments on commit 64fcda4

Please sign in to comment.