# phpdocx > phpdocx is a PHP library for generating, modifying, converting, and transforming Word and PDF documents programmatically. ## Summary phpdocx is a PHP library that allows developers to dynamically generate, modify, and transform Word documents. Key capabilities include creating new documents, template-based generation, HTML/CSS to Word conversion, PDF, images, charts, tables, document transformation, merging, watermarking, password encryption, cryptographic digital signing, tracking changes, JavaScript API, and many other features. ## Key Concepts - Generate Word DOCX and PDF documents from PHP - Create documents using templates with variable replacement - HTML and CSS to DOCX conversion - Insert images, tables, charts, and multimedia content - Headers, footers, comments, endnotes, footnotes and sections - Merge, split, and modify Office documents - Automated document generation workflows - Get information from documents - Convert documents to PDF, HTML, TXT, and other formats - Support for mathematical equations (OMML and MathML) - Watermarks (text and image overlays) - Encrypt and sign (password protection and digital signatures) - Track changes and collaborative editing features - LTR and RTL support - PDF utilities - Add, remove, clone and replace blocks in documents - Embed fonts - JavaScript API - AI-assisted document processing (summarization, keyword extraction) - Chunk and stream modes ## Core Features - [Features](https://www.phpdocx.com/features): Overview of library capabilities ## Documentation - [Documentation](https://www.phpdocx.com/documentation): Main documentation hub - [Introduction](https://www.phpdocx.com/documentation/introduction): Introduction and overview - [Practical guide](https://www.phpdocx.com/documentation/practical): Practical guides and tutorials - [Installation](https://www.phpdocx.com/documentation/practical/installation): Installation instructions - [API reference](https://www.phpdocx.com/documentation/api-documentation): API reference - [Cookbook](https://www.phpdocx.com/documentation/cookbook): Task-oriented examples and integration - [Snippets](https://www.phpdocx.com/documentation/snippets): Code snippets ## Product Information - [FAQ](https://www.phpdocx.com/faqs): Frequently asked questions - [Pricing](https://www.phpdocx.com/pricing): Licensing tiers and product editions - [News](https://www.phpdocx.com/news): Product updates and announcements ### Example: Create a Document $docx = new CreateDocx(); $docx->addText('Text content'); $docx->createDocx('example.docx'); ### Example: Create a Document from a template $docx = new CreateDocxFromTemplate('template.docx'); // replace variables $docx->replaceVariableByText(['VAR' => 'New content']); $docx->createDocx('example.docx');