PHP Word DOCX to HTML with Images: Convert Microsoft Word DOCX document to HTML

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-10-12 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 160 This week: 13All time: 8,759 This week: 30Up
Version License PHP version Categories
wordtohtml 1.0.1Custom (specified...5HTML, PHP 5, Files and Folders
Description Author

This class can convert Microsoft Word DOCX document to HTML.

It can take file name of a Microsoft Word DOCX and extract its contents to obtain the XHTML document and image files.

The class can parse the contained XHTML files and process its tags to convert Microsoft Word XHTML tags into regular HTML tags.

Currently it can convert paragraph tags, formatting tags, image tags, link tags and table tags.

Recommendations

What is the best PHP convert docx to html with images class?
Send generated docx document as body of email message

Innovation Award
PHP Programming Innovation award nominee
October 2020
Nominee
Vote
Many people use Microsoft Word application to create Word processing documents. However, Web applications use HTML to display documents in Web pages or send those documents as email messages to other people.

This class can convert Microsoft Word DOCX document with images to HTML to solve the problem of using Microsoft Word to create content to display Web pages or send it via email.

Manuel Lemos
Picture of Rohit Arya
  Performance   Level  
Name: Rohit Arya <contact>
Classes: 3 packages by
Country: India India
Innovation award
Innovation award
Nominee: 3x

 

Details

This class read a DOCX file and output it to HTML format.

USAGE

debug mode

$rt = new WordPHP(true);

without debug

$rt = new WordPHP(false); or $rt = new WordPHP();

Set output encoding

$rt = new WordPHP(false, OUTPUT_ENCODING);

Read docx file and returns the html code

$text = $rt->readDocument(FILENAME);

NOTE:

To load images, please create a tmp folder where images can be extracted and saved from the document. Don't forget to change the permissions in that folder so that the user that runs this class can write the images in it.

  Files folder image Files  
File Role Description
Files folder imagetmp (3 files)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file test.php Example Example script
Plain text file wordphp.php Class Class source

  Files folder image Files  /  tmp  
File Role Description
  Accessible without login Image file rId4.jpg Data Auxiliary data
  Accessible without login Image file rId5.jpeg Data Auxiliary data
  Accessible without login Image file rId6.jpeg Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:160
This week:13
All time:8,759
This week:30Up

For more information send a message to info at phpclasses dot org.