I am using smalot pdfparser for parsing pdfs. While parsing, I am trying to get font details like font family, font size etc. According to this API Doc, it has mentioned getFonts and getFont methods. I am trying to get it, but getting some object. Follow this link to more about it. This is code I am using
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile('hw.pdf');
$pages = $pdf->getPages();
$page = $pages[0];
$fonts = $page->getFonts();
print_r($fonts);
Kindly let me, if you have any idea. OR is there any other way to achieve this?
Maybe, just maybe, you don't need it anymore 2 year later :), but you can iterate over that collection and call getName()
foreach($page->getFonts() as $font) {
print_r($font->getName() . PHP_EOL);
}