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

example

  1. <?php
  2.  
  3. /**
  4.  * Inserts a textbox in a Word document.
  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 1.8
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $paramsText array(
  21.     'b' => 'single',
  22.     'font' => 'Arial',
  23.     'color' => 'red'
  24. );
  25.  
  26. $text 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
  27.     'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
  28.     'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
  29.     'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
  30.     'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
  31.     'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
  32.     'officia deserunt mollit anim id est laborum.';
  33.  
  34. $options array(
  35.     'width' => 10,
  36.     'height' => 8,
  37.     'fillcolor' => '#0000ff',
  38.     'textWrap' => 'square',
  39.     'padding_left' => 2.1,
  40.     'padding_top' => 1,
  41.     'padding-right' => 0.5,
  42.     'margin_top' => 1,
  43.     'margin_left' => 2,
  44.     //'border' => 4,
  45.     //'border_color' => 'green'
  46. );
  47.  
  48. $docx->addTextBox(
  49.     array(
  50.         'text' => $text,
  51.         'args' => $paramsText
  52.     ),
  53.     $options
  54. );
  55.  
  56. $docx->createDocx('../docx/example_textbox');

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