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

public function addTextBox(array(’text’ => $text, ‘args’ => $paramsText), $paramsBox = array())

Parameters

$paramsBox

  • ‘margin_top’ (top margin): 100,..
  • ‘margin_bottom’ (bottom margin): 100, ..
  • ‘margin_right’ (right margin): 100, ..
  • ‘margin_left’ (left margin): 100, ..
  • ‘width’ (width): 800, ..
  • ‘height’ (height): 800, ..
  • ‘align’(text alignment): right, center
  • ‘fillcolor’ (fill color): red,black,…
  • ‘jc’ (text box alignment): square, through
  • ‘font’ (A specific size and style of font type within a type family. Example ‘Times New Roman’, ‘Arial’,…)


$paramsText (type = array)

  • ‘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 a new page (widow) or the first line of a paragraph at the bottom of a page (orphan)): on, off
  • ‘wordWrap’ (allows line breaks in the middle of a word): on, off

Examples

Example 1 Version Pro


require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$paramsText = array(
    'b' => 'single',
    'font' => 'Arial'
);

$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
    'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
    'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
    'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
    'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
    'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
    'officia deserunt mollit anim id est laborum.';

$paramsTextBox = array(
    'jc' => 'through'
);

$docx->addTextBox(
    array(
        'text' => $text,
        'args' => $paramsText
    ),
    $paramsTextBox
);

$docx->createDocx('example_textbox');

Comments are closed.