Hi,
i'm trying to create a pdf document on the fly.
i've created the following simple action:
--------
public function
previewfpAction() {
$response = $this->getResponse();
$pdf = new Zend_Pdf();
$page =
$pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;
// Set font
$page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA),
20);
// Draw text
$page->drawText('Hello world!', 100,
510);
$pdf->save('/var/www/documents/upload/tester.pdf');
header('Content-type: application/pdf');
$pdfData = $pdf->render();
echo $pdfData;
}
---------
i call the action like this:
test/registrant/previewfp
the name of the controller is registrant.
but firefox reports an error:
File not found
Firefox can't find the file at
http://192.168.1.31/test/registrant/previewfp.
the same goes for IE.
what am i doing wrong?
can anyone point out what i should do? i think i've followed the
documentation.
the document is created because i can save it and see the result. but
the browser won't accept it.
thanks in advance
kim