I am having set of pdf documents and I need to convert the files to excel, when I tried to convert those I could not convert it was stating failed. So I have tried to convert to HTML tag all the data are converting but it was changing the whole document into P tags. I have attached the sample response of HTML tags. Please suggest me some ides for converting pdf to excel in php.
I have used the below mentioned library
https://www.phpclasses.org/package/9423-PHP-Convert-PDF-to-HTML-using-Poppler.html
<p class="ft00" style="margin: 0; padding: 0; font-size: 11px; font-family: Times; color: #000000; position: absolute; top: 863px; left: 683px; white-space: nowrap;"><b>10</b></p>
<p class="ft01" style="margin: 0; padding: 0; font-size: 9px; font-family: Times; color: #000000; -moz-transform: matrix( 0, -1, 0.9999875, 0, 0, 0); -webkit-transform: matrix( 0, -1, 0.9999875, 0, 0, 0); -o-transform: matrix( 0, -1, 0.9999875, 0, 0, 0); -ms-transform: matrix( 0, -1, 0.9999875, 0, 0, 0); -moz-transform-origin: left 75%; -webkit-transform-origin: left 75%; -o-transform-origin: left 75%; -ms-transform-origin: left 75%; position: absolute; top: 207px; left: 63px; white-space: nowrap;"><b>THE</b></p>
Library: PdfToHtml
$pdf = new \TonchikTm\PdfToHtml\Pdf($pdf_file , [
'pdftohtml_path' => $bindir,
'pdfinfo_path' => $binexe,
'outputDir' => getcwd().'/excelfile/'.uniqid() // output dir
]);
$newpage = '';
foreach ($pdf->getHtml()->getAllPages() as $page) {
$newpage .= $page . '<br/>';
}
Aucun commentaire:
Enregistrer un commentaire