Created
December 22, 2009 16:36
-
-
Save meritt/261839 to your computer and use it in GitHub Desktop.
Пример использования Zend_Service_LiveDocx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date = new Zend_Date(); | |
$date->setLocale('ru_RU'); | |
$liveDocx = new Zend_Service_LiveDocx_MailMerge(); | |
$liveDocx->setUsername('myUsername') | |
->setPassword('myPassword'); | |
$liveDocx->setLocalTemplate('template.docx'); | |
$liveDocx->assign('company', 'Сиренити') | |
->assign('date', $date->get(Zend_Date::DATE_LONG)) | |
->assign('time', $date->get(Zend_Date::TIME_LONG)) | |
->assign('city', 'Санкт-Петербург') | |
->assign('country', 'Россия'); | |
$liveDocx->createDocument(); | |
$document = $liveDocx->retrieveDocument('pdf'); | |
file_put_contents('document.pdf', $document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment