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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -