Register Lost your password?
Full api documentation: full api documentation FREE version full api documentation PRO version

public function addTitle(string text, array paramsTitle = array())

Parameters

text

  • Text of the title



$paramsTitle

  • ‘val’ (title type): 1, 2, 3,…
  • ‘type’ (type): subtitle o title
  • ‘b’ (bold): ’single’
  • ‘color’ (color RGB): FF0000, 000000, FFFFFF,…
  • ‘i’ (italic): ’single’
  • ‘jc’ (text alignment): ‘left’, ‘center’, ‘right’, ‘both’, ‘distribute’
  • ’sz’ (size): 1, 2, 3, 4,…
  • ‘u’ (underline): ’single’, ‘words’, ”double’, ‘dotted’, ‘dash’, ‘wave’
  • ‘pageBreakBefore’ (forces a page break before a paragraph) : on, off
  • ‘widowControl’ (prevents Word from printing the last line of a paragraph by itself at the top of the page (widow) or the first line of a paragraph at the bottom of a page (orphan)) : on, off
  • ‘wordWrap’ (breaks a line in the middle of a word) : on, off
  • ‘font’ (A specific size and style of font type within a type family. Example ‘Times New Roman’, ‘Arial’,…)

Examples

Example 1


require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$paramsTitle = array(
    'val' => 1,
    'u' => 'single',
    'font' => 'Blackadder ITC',
    'sz' => 22
);

$docx->addTitle('Lorem ipsum dolor sit amet.', $paramsTitle);

$docx->createDocx('example_title');

Comments are closed.