Search code examples
phpconvertersdocxdocpdf-to-html

how to get html code from pdf,docx,doc using php


I want to convert any pdf,docx,doc file into html code using php. with same style as in pdf. I am not getting proper solution.

                            Config::set('pdftohtml.bin', 'C:/poppler-0.37/bin/pdftohtml.exe');

                            // change pdfinfo bin location
                            Config::set('pdfinfo.bin', 'C:/poppler-0.37/bin/pdfinfo.exe');
                            // initiate
                            $pdf = new Gufy\PdfToHtml\Pdf($item);

                            // convert to html and return it as [Dom Object](https://github.com/paquettg/php-html-parser)
                            $html = $pdf->html();

Not working for me.


Solution

  • 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