Working with accents and other non-ASCII UTF8 characters

phpdocx allows to add texts with accents, umlauts and other non-ASCII, special UTF8 characters. That includes either creating new documents, or when working with templates, importing HTML or converting to PDF.

The only requirement to properly add those characters is that the text strings have to be UTF-8, which means that you must use a UTF-8 editor. Eclipse for Windows doesn't use UTF-8 as default. If the data source is not UTF-8, e.g., from a DDBB in ISO-8859, you can easily convert the strings with the PHP iconv function (

When importing HTML with the embedHtml method, it is necessary to install and set up the PHP Tidy extension ( and the PHP mbstring extension. These extensions are available in any Linux, Windows and macOS servers.