API Documentation

Download PHPDocX

download PhpDocX

Choose the version that better suits your needs

Click here

ON DEMAND

On demand

Do you have
special needs?

You may ask here for a quote

Support

Support

Do you need technical support?

We can help

parseStyles

Generates a Word document with the available styles

PRO, PRO+ and CORPORATE PHPDocX >= 2.5

Description

public function parseStyles (string $path)

This method generates an auxiliary Word document with all the available styles in a given Word document.

With the help of this method we may generate a Word document indicating not only the available styles but also how they they can be used with the addText, addTable and addList methods.

Parameters

path

The path to the Word document from which we want to import the styles. If empty parses the styles of the current base template.

Return values

Void.

Code samples

Example #1: generates a document with available styles and sample code


require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$docx->parseStyles();

$docx->createDocx('available_styles');

The resulting Word document looks like (download .docx file):

Change log

  • Available since 2.5

See also