how to get html code from pdf,docx,doc using php
I had a similar problem and i found a github that i used with word docs. It worked fairly good then but i havent tested it of late. try it.
https://github.com/benbalter/Convert-Word-Documents-to-HTML
docx to html with phpword issue
There's a little bit of a problem when it comes to using IOFactory::load of PHPWord such as what you encountered now, depending what saved the file or what version of Microsoft Word is used to create that file. If the encoding and tags of the docx file cannot be found by PHPWord , then it will produce unexpected results
The code is fine, the problem is already with the dependency.
PHP Convert Word file to HTML without losing styling and images
I've spent a bit of time loking into this, and the best solution that I've found was to install unoconv on the server, and using PHP to interface with it through system calls.
I would have loved to find a good native PHP solution for this, but unfortunately I couldn't.
Edit
Since originally answering this, I've come across a web service which presents an API for converting documents. I haven't tested it very thoroughly but it does seem to produce decent results at converting Word to HTML: CloudConvert.
How to convert .docx file into .doc file with PHP?
If you want to get the text out of .docx file and save it as a text file then you can use the library docx2text
after converting it to text file you can read the text file line by line and keep each line data in an array.
Related Topics
Double Not (!!) Operator in PHP
Getting the First Character of a String with $Str[0]
PHP Is Not Recognized as an Internal or External Command in Command Prompt
Unit Testing and Static Methods
Asynchronous Function Call in PHP
How to Create a Custom Admin Page in Opencart
How to Switch from Post to Get in PHP Curl
PHP - Get Numeric Index of Associative Array
How to Get File Url Using Storage Facade in Laravel 5
PHP Errors Not Being Displayed in the Browser [Ubuntu 10.10]
Can't Insert Chinese Character into MySQL
MySQL Diacritic Insensitive Search (Spanish Accents)
"PHP Fatal Error: Class 'Httprequest' Not Found"