Mam pytanie.
Chce wygenerować dokument PDF w zf 1.11
Robię tak:
$pdf = new Zend_Pdf(); $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); $font = Zend_Pdf_Font::fontWithPath(Zend_Pdf_Font::FONT_TIMES); $page->setFont($font, 24) ->drawText('tekst,', 72, 720) ->drawText('tekst.', 72, 620); $pdf->pages[] = $page; $pdf->save('example.pdf');
I dostaje bład że nie ma czcionki, gdzie mam je znaleźć i skopiować ?
Pozdrawiam
Adibak
Wiem już czegoś brakuje:
Fonty mam te klasy ale nie wiem w czym rzecz ...
Message: Invalid file path: Times-Bold
Stack trace:
#0 C:\xampp\ZendFramework-1.11\library\Zend\Pdf\Font.php(603): Zend_Pdf_FileParserDataSource_File->__construct('Times-Bold')
#1 C:\xampp\htdocs\mgr\6_zend\application\controllers\HelloController.php(23): Zend_Pdf_Font::fontWithPath('Times-Bold')
#2 C:\xampp\ZendFramework-1.11\library\Zend\Controller\Action.php(513): HelloController->pdfAction()
#3 C:\xampp\ZendFramework-1.11\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('pdfAction')
#4 C:\xampp\ZendFramework-1.11\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#5 C:\xampp\ZendFramework-1.11\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#6 C:\xampp\ZendFramework-1.11\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#7 C:\xampp\htdocs\mgr\6_zend\public\index.php(26): Zend_Application->run()
#8 {main}
Request Parameters:
array (
'controller' => 'hello',
'action' => 'pdf',
'module' => 'default',
)