Skip to content

Commit

Permalink
Merge pull request #41 from scotam/issue-33
Browse files Browse the repository at this point in the history
Fix for Object classes returned as Fonts
  • Loading branch information
smalot committed Jul 7, 2014
2 parents 6567e04 + 19a953a commit b5c4745
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Binary file added samples/bugs/Issue33.pdf
Binary file not shown.
12 changes: 7 additions & 5 deletions src/Smalot/PdfParser/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ public function getFonts()
$table = array();

foreach ($fonts as $id => $font) {
$table[$id] = $font;

// Store too on cleaned id value (only numeric)
$id = preg_replace('/[^0-9\.\-_]/', '', $id);
if ($id != '') {
if ($font instanceof Font) {
$table[$id] = $font;

// Store too on cleaned id value (only numeric)
$id = preg_replace('/[^0-9\.\-_]/', '', $id);
if ($id != '') {
$table[$id] = $font;
}
}
}

Expand Down

0 comments on commit b5c4745

Please sign in to comment.