Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF][ZendFramework]Generowanie PDF i font
adibak20
post
Post #1





Grupa: Zarejestrowani
Postów: 56
Pomógł: 0
Dołączył: 13.07.2011
Skąd: Lublin

Ostrzeżenie: (0%)
-----


Witam,

Mam pytanie.

Chce wygenerować dokument PDF w zf 1.11

Robię tak:

  1. $pdf = new Zend_Pdf();
  2. $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
  3. $font = Zend_Pdf_Font::fontWithPath(Zend_Pdf_Font::FONT_TIMES);
  4. $page->setFont($font, 24)
  5. ->drawText('tekst,', 72, 720)
  6. ->drawText('tekst.', 72, 620);
  7. $pdf->pages[] = $page;
  8. $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',
)

Ten post edytował adibak20 15.03.2012, 12:22:29
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 15:16