php - Extract pdf content and convert it in word or csv -
i starter. have pdf file. want php program wherein can extract content of pdf , output in word or csv.
to read pdf files, need install xpdf package, includes "pdftotext." once have xpdf/pdftotext installed, run following php statement pdf text:
content = shell_exec('/usr/local/bin/pdftotext '.$filename.' -');
after getting content, download phpdocx community version, try this.
<?php require_once '../../classes/createdocx.inc'; $docx = new createdocx(); $textinfo = $content; $paramstextinfo = array( 'val' => 1, 'i' => 'single', 'sz' => 8 ); $docx->addtext($textinfo, $paramstextinfo); $docx->createdocx('report.docx'); ?>
Comments
Post a Comment