Register Lost your password?

public function fAddTitle(string text, array arrParamsTitle = array())

Parameters

text

  • Text of the title



$arrParamsTitle

  • ‘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/cCreateDocx.inc');
$objDocx = new cCreateDocx();
$arrParamsTitle = array(
	'val' => 1,
    'u' => 'double',
    'jc' => 'right'
  );
$objDocx->fAddTitle('Lorem ipsum dolor sit amet.', $arrParamsTitle);
$objDocx->fCreateDocx('ejemplo_title');


Example 2


require_once('../classes/cCreateDocx.inc');
$objDocx = new cCreateDocx();
$arrParamsTitle = array(
	'val' => 2,
    'u' => 'double',
    'jc' => 'center'
  );
$objDocx->fAddTitle('Lorem ipsum dolor sit amet.', $arrParamsTitle);
$objDocx->fCreateDocx('ejemplo_title');

Your comments