High-quality PDF to Word conversion in PHP?
No correct solution
To read PDF files, you will need to install the XPDF package, which includes "pdftotext." Once you have XPDF/pdftotext installed, you run the following PHP statement to get the PDF text:
content = shell_exec('/usr/local/bin/pdftotext '.$filename.' -');
After getting the content, Download PHPDOCX Community version, try like 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'); ?>
By far the easiest way is with phpLiveDocx. It can load DOC, DOCX and RTF and save to PDF. It can be downloaded from http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/ The download file contains a large number of sample applications, which illustrate all aspects of the PHP5 library. Leo