Speaking of PDF libs, is there one that sucks less than the others? Don't really have a lot of experience with them, but I'm bound to need one sooner or later.
Greetz, Koen > -----Oorspronkelijk bericht----- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Namens salva > Verzonden: vrijdag 3 augustus 2007 9:20 > Aan: Agavi Users Mailing List > Onderwerp: Re: [Agavi-Users] Better way to generate a PDF > > Veikko Mäkinen escribió: > > 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 > > > > > Perfect! > Thanks > > _______________________________________________ > users mailing list > [email protected] > http://lists.agavi.org/mailman/listinfo/users > _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
