本文整理汇总了PHP中CreateDocx::addFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP CreateDocx::addFooter方法的具体用法?PHP CreateDocx::addFooter怎么用?PHP CreateDocx::addFooter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreateDocx
的用法示例。
在下文中一共展示了CreateDocx::addFooter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateDocx
<?php
//path to the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
//Create a Word fragment with an image to be inserted in the header of the document
$imageOptions = array('src' => '../../img/image.png', 'dpi' => 300);
$default = new WordFragment($docx, 'defaultFooter');
$default->addImage($imageOptions);
$first = new WordFragment($docx, 'firstFooter');
$first->addText('first page footer.');
$even = new WordFragment($docx, 'evenFooter');
$even->addText('even page footer.');
$docx->addFooter(array('default' => $default, 'first' => $first, 'even' => $even));
//add some text
$docx->addText('This is the first page of a document with different footers for the first and even pages.');
$docx->addBreak(array('type' => 'page'));
$docx->addText('This is the second page.');
$docx->addBreak(array('type' => 'page'));
$docx->addText('This is the third page.');
$docx->createDocx('example_addFooter_2');
示例2: CreateDocx
<?php
//path to the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
//Create a Word fragment with an image to be inserted in the header of the document
$imageOptions = array('src' => '../../img/image.png', 'dpi' => 300);
$footerImage = new WordFragment($docx, 'defaultFooter');
$footerImage->addImage($imageOptions);
$docx->addFooter(array('default' => $footerImage));
//add some text
$docx->addText('This document has a footer with just one image.');
$docx->createDocx('example_addFooter_1');
示例3: CreateDocx
<?php
/**
* Create a DOCX file. Footer example
*
* @category Phpdocx
* @package examples
* @subpackage easy
* @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
* (http://www.2mdc.com)
* @license LGPL
* @version 2.0
* @link http://www.phpdocx.com
* @since File available since Release 2.0
*/
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$paramsFooter = array('font' => 'Times New Roman');
$docx->addFooter('Footer. Times New Roman font', $paramsFooter);
$docx->createDocx('example_footer');
示例4: CreateDocx
<?php
/**
* Create a DOCX file. Header and footer with font styles
*
* @category Phpdocx
* @package examples
* @subpackage intermediate
* @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
* (http://www.2mdc.com)
* @license LGPL
* @version 2.0
* @link http://www.phpdocx.com
* @since File available since Release 2.0
*/
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$paramsHeader = array('name' => '../files/img/image.png', 'jc' => 'right', 'textWrap' => 5, 'font' => 'Arial');
$docx->addHeader('Header Arial', $paramsHeader);
$paramsHeader = array('font' => 'Times New Roman');
$docx->addHeader('Header Times New Roman', $paramsHeader);
$paramsFooter = array('pager' => 'true', 'pagerAlignment' => 'center', 'font' => 'Arial');
$docx->addFooter('Footer Arial', $paramsFooter);
$docx->createDocx('example_header_and_footer');