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

public function addSection(array paramsSection = array())

Parameters

$paramsSection

  • ‘orient’ (page orientation) :’landscape’
  • ‘top’ (top margin) : 4000,..
  • ‘bottom’ (bottom margin) : 4000,..
  • ‘right’ (right margin) : 4000,..
  • ‘left’ (left margin): 4000,..
  • ‘titlePage’ (if the first page contains the header): 1

Examples

Example 1 Version Pro


require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$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.';

$docx->addText($text);

$paramsText = array(
    'b' => 'single'
);

$docx->addText($text, $paramsText);

$paramsSection = array(
    'orient' => 'landscape',
    'top' => 4000,
    'bottom' => 4000,
    'right' => 4000,
    'left' => 4000
);
$docx->addSection($paramsSection);

$docx->addText($text);

$paramsText = array(
    'b' => 'single'
);

$docx->addText($text, $paramsText);

$docx->createDocx('example_section');

    One Response

  • boilingsnail

    This is a ‘next page’ type of new section command in Word. The new formatting starts on the next page.

    A ‘continuous’ new section command starts the new formatting immediately on the same page. This allows, for instance, to change the number of columns half way down the page.

    Is a ‘continuous’ new section command possible? Is it on the ‘to do’ list ?

Your comments