example

  1. <?php
  2.  
  3. /**
  4.  * Create a DOCX file. Header and footer with font styles
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage intermediate
  9.  * @copyright  Copyright (c) 2009-2011 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    1.8
  13.  * @link       http://www.phpdocx.com
  14.  * @since      File available since Release 1.8
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $paramsHeader array(
  21.     'name' => '../files/img/image.png',
  22.     'jc' => 'right',
  23.     'textWrap' => 5,
  24.     'font' => 'Arial'
  25. );
  26.  
  27. $docx->addHeader('Header Arial'$paramsHeader);
  28.  
  29. $paramsHeader array(
  30.     'font' => 'Times New Roman'
  31. );
  32.  
  33. $docx->addHeader('Header Times New Roman'$paramsHeader);
  34.  
  35. $paramsFooter array(
  36.     'pager' => 'true',
  37.     'pagerAlignment' => 'center',
  38.     'font' => 'Arial'
  39. );
  40.  
  41. $docx->addFooter('Footer Arial'$paramsFooter);
  42.  
  43. $paramsFooter array(
  44.     'font' => 'Times New Roman'
  45. );
  46.  
  47. $docx->addFooter('Footer Times New Roman'$paramsFooter);
  48. $docx->createDocx('example_header_and_footer');

Documentation generated on Thu, 02 Jun 2011 16:14:45 +0200 by phpDocumentor 1.4.3