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

example

  1. <?php
  2.  
  3. /**
  4.  * Insert a Word document within another 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 2.3
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $docx->addText('DOCX content');
  21.  
  22. $docx->addDOCX(array('pathDOCX' => '../files/Text.docx'));
  23.  
  24. $docx->addText('End DOCX content');
  25.  
  26. $docx->addText('Now we are going to insert twice the same DOCX in a table cell:');
  27.  
  28. $DOCXdata $docx->addDOCX(array('pathDOCX' => '../files/Text.docx''rawWordML' => true));
  29.  
  30. $fragment $docx->createWordMLFragment(array($DOCXdata$DOCXdata));
  31.  
  32. $valuesTable array(
  33.     array(
  34.         11,
  35.         12
  36.     ),
  37.     array(
  38.         $fragment,
  39.         22
  40.     ),
  41. );
  42.  
  43. $paramsTable array(
  44.     'border' => 'single',
  45.     'border_sz' => 5,
  46. );
  47.  
  48. $test $docx->addTable($valuesTable$paramsTable);
  49.  
  50. $docx->createDocx('../docx/example_docx');

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