2017 © Pedro Peláez
 

library docx

PHP Based Docx Parser, based on original work by PhilGale92/docx

image

lmerotta/docx

PHP Based Docx Parser, based on original work by PhilGale92/docx

  • Wednesday, June 15, 2016
  • by lmerotta
  • Repository
  • 2 Watchers
  • 0 Stars
  • 942 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Docx Parser

This PHP based parser takes any docx file, and creates a PHP array containing its structure, content & style information. Simply import any style data (as demonstrated within index.php) using the word style name & any desired attributes and run the parser., (*1)

====, (*2)

Supports: - Word styles - Paragraphs - Text indentation / tabbing - Nested lists (& inline lists) - Tables (Vertical cell merging + colspans) - Images (& finding the required image size) - Hyperlinks (With mailto: support) - Bold / Underlined / Italic text - Textboxes (Parser support added, but not rendered) - Table of content functionality (You likely need to extend the docx class & modify the ->render() class), (*3)

====, (*4)

Known Bugs:, (*5)

  • Tables cells that us the following pattern don't render properly:
Example (incorrect render)
-------------
cell 1
cell 2
cell 3
cell 4

Cell 1 + 2 are vertically merged. Then there is a border, cell 3 + 4 are merged. The renderer cannot differentiate between multiple vertical merges that don't have a standard cell between them., (*6)

The following layout is fine, as cell 3 is a standard cell dividing the two vertical merges:, (*7)

Example (works)
-------------
cell 1
cell 2
--------
cell 3
cell 4
cell 5

====, (*8)

Caveats:, (*9)

  • Images are displayed at the same dimensions as in word, however the included rendering class does not contain functionality for resizing the raw image files as required (due to it being out of scope for this project)
  • The parser may take some time to run on larger documents
  • Modifying text in word to look the same as a header style is not the same as setting its stylename to 'header'

====, (*10)

Requirements:, (*11)

  • PHP 5.3 or greater
  • /tmp writable by PHP

The Versions

15/06 2016

dev-refactor

dev-refactor

PHP Based Docx Parser, based on original work by PhilGale92/docx

  Sources   Download

MIT

by Lucio Merotta

15/06 2016

0.1.1

0.1.1.0

PHP Based Docx Parser, based on original work by PhilGale92/docx

  Sources   Download

MIT

by Lucio Merotta

02/06 2016

0.1.0

0.1.0.0

PHP Based Docx Parser, based on original work by PhilGale92/docx

  Sources   Download

MIT

by Lucio Merotta

30/05 2016

dev-master

9999999-dev

PHP Based Docx Parser, based on original work by PhilGale92/docx

  Sources   Download

MIT

by Lucio Merotta