I am trying to read data from pdf and save into separate columns(Name,Address,Email,Company) but the smalot/pdfparser returning output as string
<code>$parser = new SmalotPdfParserParser();
$pdf = $parser->parseFile('document.pdf');
$output= $pdf->getText();
echo $output;
</code>
<code>$parser = new SmalotPdfParserParser();
$pdf = $parser->parseFile('document.pdf');
$output= $pdf->getText();
echo $output;
</code>
$parser = new SmalotPdfParserParser();
$pdf = $parser->parseFile('document.pdf');
$output= $pdf->getText();
echo $output;
output = Name:test Address:test 123 email:[email protected] company:abc
How can I convert this to an array like this
<code>[
'Name'=> 'test',
'Address'=> 'test 123',
'Email`=>`[email protected]',
'Company'=>'ABC'
]
</code>
<code>[
'Name'=> 'test',
'Address'=> 'test 123',
'Email`=>`[email protected]',
'Company'=>'ABC'
]
</code>
[
'Name'=> 'test',
'Address'=> 'test 123',
'Email`=>`[email protected]',
'Company'=>'ABC'
]