create
[ class tree: create ] [ index: create ] [ all elements ]

example

  1. <?php
  2.  
  3. /**
  4.  * Inserts automatic page numbering in a header
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage easy
  9.  * @copyright  Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
  10.  *              (http://www.2mdc.com)
  11.  * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
  12.  * @version    2012.12.26
  13.  * @link       http://www.phpdocx.com
  14.  * @since      File available since Release 3.0
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $options array('jc' => 'right',
  21.                  'b' => 'on',
  22.                  'sz' => 14,
  23.                  'color' => 'ff0000',
  24.                  'rawWordML' => true);
  25.  
  26. $numbering $docx->addPageNumber('numerical'$options);
  27.  
  28. $WordMLFragment $docx->createWordMLFragment(array($numbering));
  29.  
  30. $docx->addHeader(array('default' => $WordMLFragment));
  31.  
  32. //Now we include a couple of pages to better illustrate the example
  33. $docx->addText('This is the first page.');
  34. $docx->addBreak(array('type' => 'page'));
  35. $docx->addText('This is the second page.');
  36. $docx->addBreak(array('type' => 'page'));
  37. $docx->addText('This is the third page.');
  38.  
  39. $docx->createDocx('../docx/example_pageNumber');

Documentation generated on Mon, 13 Jan 2014 13:44:08 +0100 by phpDocumentor 1.4.4