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


PHP CreateDocx::addShape方法代码示例

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


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

示例1: CreateDocx

<?php

//path to  the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addText('Arc:');
$options = array('width' => 70, 'height' => 70, 'fillcolor' => '#555555', 'strokecolor' => '#ff0000', 'strokeweight' => '4', 'startAngle' => 0, 'endAngle' => 210);
$docx->addShape('arc', $options);
$docx->addText('Curve:');
$options = array('from' => '300,40', 'to' => '120,150', 'fillcolor' => '#555555', 'strokecolor' => '#ff0000', 'strokeweight' => '4', 'control1' => '60,70', 'control2' => '125,170');
$docx->addShape('curve', $options);
$docx->addText('Line:');
$options = array('from' => '10,10', 'to' => '150,10', 'strokecolor' => '#0000ff', 'strokeweight' => '2', 'position' => 'absolute', 'margin-left' => 20);
$docx->addShape('line', $options);
$docx->addText('Polyline:');
$options = array('points' => '10,10 20,20 25,10 40,7 3,55', 'strokecolor' => '#ff00ff', 'strokeweight' => '2', 'position' => 'absolute', 'marginLeft' => 40);
$docx->addShape('polyline', $options);
$docx->addBreak();
$docx->addText('Rectangle:');
$options = array('width' => 60, 'height' => 20, 'strokecolor' => '#ff00ff', 'strokeweight' => '3', 'fillcolor' => '#ffff00', 'position' => 'absolute', 'marginLeft' => 10, 'marginTop' => -5);
$docx->addShape('rect', $options);
$docx->addText('Rounded rectangle:');
$options = array('width' => 60, 'height' => 30, 'strokecolor' => '#ff00ff', 'strokeweight' => '3', 'fillcolor' => '#ffff00', 'position' => 'absolute', 'marginLeft' => 60, 'marginTop' => 2, 'arcsize' => 0.3);
$docx->addShape('roundrect', $options);
$docx->addBreak();
$docx->addText('Arbitrary shape:');
$options = array('path' => 'm,118hdc80,65,159,24,252,v33,11,66,24,100,34c374,41,413,29,419,51v30,109,-6,
202,-100,234c308,296,299,311,285,318v-31,16,-100,34,-100,34c140,341,
92,339,51,318,33,309,20,288,17,268,14,251,34,218,34,218hal,118hdxe', 'width' => 40, 'height' => 40, 'strokecolor' => '#000000', 'strokeweight' => '2', 'fillcolor' => '#ff0000', 'position' => 'absolute', 'marginLeft' => 5, 'marginTop' => 0);
$docx->addShape('shape', $options);
$docx->addText('The same arbitrary shape but with negative z-index and a negative margin-top so it is drawn behind this text.');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:sample_1.php


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