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

example

  1. <?php
  2.  
  3. /**
  4.  * List with embeded elements: image, list, chart and textbox
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage intermediate
  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. $paramsLink array(
  21.     'url' => 'http://www.google.es',
  22.     'sz' => 24,
  23.     'u' => 'single',
  24.     'rawWordML' => true
  25. );
  26.  
  27. $link $docx->addLink('Link to Google'$paramsLink);
  28.  
  29. $myLink $docx->createWordMLFragment($link);
  30.  
  31. $paramsImage array(
  32.     'name' => '../files/img/image.png',
  33.     'dpi' => 300,
  34.     'rawWordML' => true
  35. );
  36.  
  37. $image $docx->addImage($paramsImage);
  38. $myImage $docx->createWordMLFragment($image);
  39.  
  40. $legends array(
  41.     'legend1' => array(10),
  42.     'legend2' => array(24),
  43.     'legend3' => array(40)
  44. );
  45.  
  46. $paramsChart array(
  47.     'data' => $legends,
  48.     'type' => 'pie3DChart',
  49.     'title' => 'Title',
  50.     'rawWordML' => true
  51. );
  52. $chart $docx->addChart($paramsChart);
  53. $myChart $docx->createWordMLFragment($chart);
  54.  
  55.  
  56.  
  57. $valuesList array(
  58.     'Line 1',
  59.     $myLink,
  60.     $myImage,
  61.     $myChart,
  62.     'Line 2',
  63.     'Line 3'
  64. );
  65. $paramsList array(
  66.     'val' => 1
  67. );
  68. $docx->addList($valuesList$paramsList);
  69.  
  70. $docx->createDocx('../docx/example_list');

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