salva wrote:
> Hi,
> Can I define a output_type to get a PDF doc?
You most certainly can define such an output type but you do realise
Agavi doesn't have a PDF library built in it, don't you? There are many
to choose from (but they all suck more or less).
Here's an example of the output type stuff:
output_types.xml:
=================
<output_type name="pdf">
<parameter name="http_headers">
<parameter name="Content-Type">application/pdf</parameter>
</parameter>
</output_type>
PrintSuccessView.class.php
==========================
public function executePdf(AgaviRequestDataHolder $rd)
{
$this->getResponse()->setHttpHeader('Content-Disposition',
'attachment; filename="mydocument_123.pdf"');
// after you have built the document, just set the
// content of the (local) response
$this->getResponse()->setContent($doc->render());
}
-veikko
P.S. If you want to send an existing PDF file, all you have to do in
executePdf() is
$this->getResponse()->setContent(fopen('my_static_doc.pdf)); I.e. you
don't need to read the document into memory first.
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users