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

example

  1. <?php
  2.  
  3. /**
  4.  * Creates a paragraph style and and inserts a text with that same style via de addText method.
  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    2013.09.06
  13.  * @link       http://www.phpdocx.com
  14.  * @since      File available since Release 3.4
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19. //Style options
  20. $style array(
  21.     'color' => '999999',//text color
  22.     'border' => 'on',
  23.     'border-color' => '990000',
  24.     'border-width' => 12,
  25.     'indent_left' => 920
  26.     );
  27. //Create custom style
  28. $docx->createParagraphStyle('myStyle'$style);
  29. $text'A paragraph in grey color with a thick red border and a big left indentation.';
  30. $docx->addText($textarray('pStyle' => 'myStyle'));
  31. $docx->createDocx('../docx/example_paragraphstyle');

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