This question already has an answer here:
Hi this is my first post here.
I have trouble in converting a docx file to pdf from PHP. I am using PHPDOCX to convert the docx to xhtml and then pass the XHTML to TCPDF to generate the PDF. But I am losing a lot of formatting.
So I guess the above method is pointless.
Is there any free libraries that converts docx to pdf on the fly from PHP?
</div>
you can go through the fallowing link,there we have phpdocx library.It may help you
www.phpdocx.com
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
$phpLiveDocx->setUsername('username')
->setPassword('password');
$phpLiveDocx->setLocalTemplate('document.doc');
// necessary as of LiveDocx 1.2
$phpLiveDocx->assign('dummyFieldName', 'dummyFieldValue');
$phpLiveDocx->createDocument();
$document = $phpLiveDocx->retrieveDocument('pdf');
file_put_contents('document.pdf', $document);
unset($phpLiveDocx);
Click here To details