createDocxAndDownload

createDocxAndDownload

TRIAL / ADVANCED / PREMIUM

Generates and downloads the Word document.

Description
public createDocxAndDownload ( [string $fileName, bool $removeAfterDownload] )
Parameters

fileName

File name of the document to download. This option also sets the target folder to be used to generate the DOCX before downloading it.

removeAfterDownload

Removes the file after the download dialog opens.

Exceptions

License not valid.

Unclosed bookmarks.

Error generating the file.

Code samples

Example #1

Release notes
  • phpdocx 10.0:
    • supported '/' as directory separator on Windows.
  • phpdocx 7.0:
    • removeAfterDownload option.