ahmedshareefogp / docx-manager
A PHP library to generate, modify, and manage DOCX files (Laravel-friendly).
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ahmedshareefogp/docx-manager
Requires
- php: >=8.0
- illuminate/support: ^11.0 || ^12.0
- phpoffice/phpword: ^1.0
- symfony/process: ^7.0
README
๐งฉ DocxManager
DocxManager is a powerful PHP library for reading, editing, and rebuilding .docx documents โ without needing Microsoft Word. It lets you replace placeholders, repeat table rows or sections, tweak text formatting, and handle checkboxes โ all while preserving the original document structure and styling.
Version 1.0 ๐ Features
- Smart Placeholder Replacement โ Replace tags like v_first_name_v across paragraphs, tables, and lists without breaking formatting.
- Repeating Sections โ Duplicate or remove content blocks between markers (e.g., rr__rstart__rr / rr__rend__rr) using array data.
- Run & Font Controls โ Modify font size, color, and styles on individual text runs while preserving document structure.
- Paragraph & Spacing Tools โ Adjust line height, before/after spacing, and fix RTL indentation in tables or lists.
- Checkbox & Form Handling โ Automatically update checkboxes and form fields based on provided data.
- Lightweight & Framework-Agnostic โ 100% PHP; works with Laravel, Symfony, or standalone projects.
- Safe DOCX Repackaging โ Maintains media, styles, and relationships during file rebuilds.
- Extensible Design โ Modular methods for easy customization and future feature expansion.
๐งช Coming Soon (v1.1+)
- Streaming placeholder replacement
- Hybrid Processing Mode โ Combines DOM and streaming XML for high performance and low memory use, even on large DOCX files.
- Built-in benchmarking (track option)