0

IN MY CONTROLLER:

use ZendPdf\PdfDocument;
public function monthlyReportPdfAction(){
    $pdf = new PdfDocument();
    $pdf->pages[0] = new Page( Page::SIZE_A4 );$pdf->pages[0]->setFont( Font::fontWithName( Font::FONT_HELVETICA ), 24 );$pdf->pages[0]->drawText( 'Hello world!', 240, 400 );
    $pdf->save( 'example.pdf' );
}

MY zendpdf in vendor I have created one .phtml and one href in index,,

Martin Hujer
  • 168
  • 6

2 Answers2

0

If you are trying to use ZendPdf Stand alone you can check previous answer: Zend PDF

You may also want to check ZF2 documentation for The Standard Autoloader which give detailed information about namespaces. ZF2 Standard Autoloader

Community
  • 1
  • 1
Serhat Akay
  • 536
  • 3
  • 10
  • I updated my composer again???? now my issue cleared but I am getting empty screen when I click my pdf hyperlink??????give some examples – bhuvaneshwaran Oct 04 '13 at 10:33
0
use ZendPdf\Font as Font;
use ZendPdf\Page as Page;
use ZendPdf\PdfDocument as PdfDocument;

In class:

 public function exportpdfAction()
    {
        $pdf = new PdfDocument();

        $pdf->pages[0] = new Page( Page::SIZE_A4 );
        $pdf->pages[0]->setFont( Font::fontWithName( Font::FONT_HELVETICA ), 24 );
        $pdf->pages[0]->drawText( 'Hello world!', 240, 400 );
        $pdf->save();

        return new ViewModel();
    }

In composer.json

"zendframework/zendpdf": "*"
sebob
  • 515
  • 6
  • 14