createDocx

createDocx

BASIC / ADVANCED / PREMIUM

Generates the Word document.

Description
public createDocx ( string $fileName )

It generates a .docx or .docm file depending on how we have called the CreateDocx constructor. The constructor admits an optional parameter: the base template. If ommited the default phpdocx base template is used.

The available options are:

  • 'docx': the default base template is used.
  • 'docm': uses the default Word document with m option is only recommended if we are going to macros with the addMacroFromDoc method.
  • The path to a custom base template.
Parameters

fileName

The path to the resulting Word document.

Return values

Void.

Code samples

Example #1