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

example

  1. <?php
  2.  
  3. /**
  4.  * Footnotes in different objects.
  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      2012.12.26
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $text 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
  21.     'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua:';
  22.  
  23. $paramsText array(
  24.     'font' => 'Arial'
  25. );
  26.  
  27. $docx->addText($text$paramsText);
  28.  
  29. $legends array(
  30.     'legend1' => array(24),
  31.     'legend2' => array(45),
  32.     'legend3' => array(31)
  33. );
  34. $args array(
  35.     'data' => $legends,
  36.     'type' => 'pie3DChart',
  37.     'title' => 'Title first chart',
  38.     'rotX' => 20'rotY' => 20'perspective' => 30,
  39.     'color' => 2,
  40.     'textWrap' => 0,
  41.     'sizeX' => 10'sizeY' => 10,
  42.     'jc' => 'left',
  43.     'showPercent' => 1,
  44.     'font' => 'Times New Roman',
  45.     'border' => 1
  46. );
  47. $docx->addChart($args);
  48.  
  49. $docx->addFootnote(
  50.     array(
  51.         'textDocument' => 'Lorem ipsum dolor sit amet',
  52.         'textFootnote' => 'Curabitur id dui purus, sit amet blandit lacus. ' .
  53.                          'Vivamus mollis magna et risus molestie blandit. ' .
  54.                          'Phasellus vel tortor quis metus consectetur.'
  55.     )
  56. );
  57.  
  58. $docx->addBreak();
  59.  
  60. $text 'Cras eget porttitor sapien. Aenean tristique, nibh quis egestas ' .
  61.         'varius, erat neque sodales neque, quis bibendum sem lorem accumsan ' .
  62.         'mauris. Aliquam justo justo, vulputate sed condimentum non, pharetra:';
  63.  
  64. $paramsText array(
  65.     'font' => 'Arial'
  66. );
  67.  
  68. $docx->addText($text$paramsText);
  69.  
  70. $paramsImg array(
  71.     'name' => '../files/img/image.png',
  72.     'scaling' => 75,
  73.     'textWrap' => 0,
  74.     'border' => 1,
  75. );
  76.  
  77. $docx->addImage($paramsImg);
  78.  
  79. $docx->addFootnote(
  80.     array(
  81.         'textDocument' => 'Aenean non gravida sapien',
  82.         'textFootnote' => 'Nunc pretium bibendum dui id laoreet. Nunc ' .
  83.                          'venenatis. Duis quis lorem vel dui tincidunt ' .
  84.                          'pellentesque quis sed diam.'
  85.     )
  86. );
  87.  
  88. $docx->createDocx('../docx/example_chart_footnote');

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