| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2b.hellogtx.com/library/PHPWordx/ |
Upload File : |
<?php
/**
* PHPWord
*
* Copyright (c) 2011 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 010 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011
*/
class PHPWordx_Createword extends Zend_Controller_Action_Helper_Abstract
{
public function printDocument( $html ){
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('PHPWordx_');
require_once 'PHPWord.php';
// New Word Document
$PHPWord = new PHPWord();
// New portrait section
$section = $PHPWord->createSection();
// Add image elements
$section->addImage('public/images/best-price.png');
$section->addTextBreak(2);
$section->addImage('public/images/best-price.png', array('width'=>210, 'height'=>210, 'align'=>'center'));
$section->addTextBreak(2);
$section->addImage('public/images/best-price.png', array('width'=>100, 'height'=>100, 'align'=>'right'));
// Add text elements
$textrun = $section->createTextRun('pStyle');
echo $aaaaa = '<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="85%" align="right" valign="middle" style="color:#8c8b89; font:normal 11px Arial, Helvetica, sans-serif;">
<img src="public/images/others/arrow_sm.png" /> Travel Proposal for ABC
</td>
<td width="15%" align="right" valign="middle" style="color:#8c8b89; font:normal 11px Arial, Helvetica, sans-serif;">
<img src="public/images/others/arrow_sm.png" /> Ref No: 1253
</td>
</tr>
</table>';
$textrun->addText('Each textrun can contain native text or link elements.');
$textrun->addText(' No break is placed after adding an element.', 'BoldText');
$textrun->addText(' All elements are placed inside a paragraph with the optionally given p-Style.', 'ColoredText');
$textrun->addText(' The best search engine: ');
$textrun->addLink('http://www.google.com', null, 'NLink');
$textrun->addText('. Also not bad: ');
$textrun->addLink('http://www.bing.com', null, 'NLink');
// Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('public/Image.docx');
}
}