当前位置: 首页>>代码示例>>PHP>>正文


PHP CreateDocx::importHeadersAndFooters方法代码示例

本文整理汇总了PHP中CreateDocx::importHeadersAndFooters方法的典型用法代码示例。如果您正苦于以下问题:PHP CreateDocx::importHeadersAndFooters方法的具体用法?PHP CreateDocx::importHeadersAndFooters怎么用?PHP CreateDocx::importHeadersAndFooters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreateDocx的用法示例。


在下文中一共展示了CreateDocx::importHeadersAndFooters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CreateDocx

 * Tutorial example
 *
 * @category   Phpdocx
 * @package    tutorial
 * @subpackage easy
 * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
 *             (http://www.2mdc.com)
 * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
 * @version    1.8
 * @link       http://www.phpdocx.com
 * @since      01/03/2012
 */
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
//Importing header and footer from external .docx file
$docx->importHeadersAndFooters('../word_documents/templateHeaderAndFooter.docx');
$text = array();
$text[] = array('text' => 'I am going to write');
$text[] = array('text' => ' Hello World!', 'b' => 'single');
$text[] = array('text' => ' using bold characters.');
$docx->addText($text);
//We first prepare an item list element with more sophisticated formatting:
$paramsItem = array(array('text' => 'This is the text associated with the first item', 'b' => 'single', 'color' => 'b70000'), array('text' => ' now without bold'), array('text' => ' and blue', 'color' => '0000b7'));
$myItem = $docx->addElement('addText', $paramsItem);
//Let us now to add a nested unordered list
$myList = array($myItem, 'item 2', array('subitem 2_1', 'subitem 2_2'), 'item 3', array('subitem 3_1', 'subitem 3_2', array('sub_subitem 3_2_1', 'sub_subitem 3_2_1')), 'item 4');
$docx->addList($myList, array('val' => 1));
$valuesTable = array(array('cell_1_1', 'cell_1_2', 'cell_1_3', 'cell_1_4'), array('cell_2_1', 'cell_2_2', 'cell_2_3', 'cell_2_4'), array('cell_3_1', 'cell_3_2', 'cell_3_3', 'cell_3_4'));
$paramsTable = array('TBLSTYLEval' => 'MediumGrid3-accent5PHPDOCX');
$docx->addTable($valuesTable, $paramsTable);
$myHTML = '<br /><p style="font-family: Calibri; font-size: 11pt">We include a table with rowspans and colspans using the embedHTML method.</p>
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:example8.php

示例2: CreateDocx

<?php

//path to  the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->importHeadersAndFooters('../../files/TemplateHeaderAndFooter.docx');
$docx->addText('This is the resulting word document with imported header and footer.');
//You may import only the header with
//$docx->importHeadersAndFooters('TemplateHeaderAndFooter.docx', 'header');
//and only the footer with
//$docx->importHeadersAndFooters('TemplateHeaderAndFooter.docx', 'footer');
$docx->createDocx('example_importHeadersAndFooters_1');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:12,代码来源:sample_1.php


注:本文中的CreateDocx::importHeadersAndFooters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。