pdfparser icon indicating copy to clipboard operation
pdfparser copied to clipboard

Method getDataTm return empty array

Open KekkoP opened this issue 3 years ago • 0 comments

  • PHP Version: 7.3
  • PDFParser Version: latest

Description:

Hi,

I'm using the latest version of smalot pdf parser, and trying to use getDataTm on the attached PDF, but always return an empty array.

PDF input

Expected output & actual output

Code

include('vendor/autoload.php');
$config = new Smalot\PdfParser\Config();
 
$config->setDataTmFontInfoHasToBeIncluded(true);

// use config and parse file
$parser = new Smalot\PdfParser\Parser([], $config);
$pdf = $parser->parseFile('test.pdf');
 
$data = $pdf->getPages()[0]->getDataTm();

var_dump($data);

test.pdf

KekkoP avatar Jan 23 '23 10:01 KekkoP