addBasicHTML

Inserts basic HTML into a Word document

PRO, PRO+ and CORPORATE PHPDocX >= 1.0

Description

public function addBasicHTML (string $html [,string $css])

This method allows you to transform HTML and CSS into WordML and insert it into your Word document.

We recommend to use the embedHTML method. This method is only kept for backwards compatibility.

Parameters

html

The XHTML code we wish to add to the Word document.

css

The (optional) CSS properties we want to add.

Return values

Void.

Code samples

Example #1: inserts basic HTML code into a Word document

require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$html= '

This will insert the name in the document: My name

'; $docx->addBasicHTML($html); $docx->createDocx('example_basic_html');

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

Change log

  • Available since 1.0

Available examples

  • There are no additional available examples.