TXT2DOCX

TXT2DOCX

TRIAL / ADVANCED / PREMIUM

Transforms plain text into WordML with custom styles.

Description
public TXT2DOCX (string $source [, array $options])

This method allows to insert contents from a TXT file into a Word document applying Word styles to it.

You may check the available styles for paragraphs, tables and lists with the help of the parseStyles method.

Parameters

source

The path to the TXT file which contents you want to insert into a Word document.

options

The possible keys and values are:

Key Type Description
styleTbl array The table style that you want to use.
styleLst array The list style that you want to use.
styleP array The paragraph style that you want to use.
Code samples

Example #1

The resulting Word document looks like: