Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 45321 invoked from network); 20 Sep 2004 15:33:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Sep 2004 15:33:14 -0000 Received: (qmail 6158 invoked by uid 500); 20 Sep 2004 15:33:12 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 6099 invoked by uid 500); 20 Sep 2004 15:33:12 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 6086 invoked by uid 99); 20 Sep 2004 15:33:11 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [200.208.9.163] (HELO smtp3.globo.com) (200.208.9.163) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 20 Sep 2004 08:33:10 -0700 Received: from localhost (localhost [127.0.0.1]) by smtp3.globo.com (Postfix) with ESMTP id 1EA6E21C69ED for ; Mon, 20 Sep 2004 12:33:01 -0300 (BRT) Received: from smtp3.globo.com ([127.0.0.1]) by localhost (riosf98 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27195-24 for ; Mon, 20 Sep 2004 12:33:00 -0300 (BRT) Received: from [192.168.0.11] (unknown [200.232.149.176]) by smtp3.globo.com (Postfix) with ESMTP id 93FF821C69F1 for ; Mon, 20 Sep 2004 12:32:59 -0300 (BRT) Message-ID: <414EF82A.8020901@engenhosolucoes.com.br> Date: Mon, 20 Sep 2004 12:32:58 -0300 From: "Luiz Fernando B. Ribeiro" Organization: Engenho =?ISO-8859-1?Q?Solu=E7=F5es_para_a_Internet?= User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lista Embperl Subject: Re: pdf generation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Ben Kim wrote: > Dear list, > > 1. pdf generation > I'd like to learn what people use to generate pdf files. I want to > create pdf from an epl page, with all data from the database. Take a look at the FOP project from the Apache Group. It's a Java subsystem able to render PDF from a xml file. http://xml.apache.org/fop/ The way to generate the xml from your epl pages depends on whether you are using Embperl 2 or 1. Below is a simple schema to achieve this with Embperl 1.3.6: [- my $html; Execute({ inputfile => 'your_page.epl', output => \$html, }); $xml_fop = html2fop($html); open F, "> /tmp/page.fop"; print F $xml_fop; close F; system('/path/to/fop/fop.sh', '/tmp/page.fop', '/tmp/page.pdf'); -] The function html2fop have to manipulate the html and transform the elements into a FOP document. This can also be done with XSLT. > > 2. Teeing the output to browser / filesystem > > Related with this, I'd also like to know whether there's a way to print > the html results of the database-driven epl page into a static html file. > > The problem I have is that the epl pages are protected, and I don't want > to mess with session id and other auth tokens when I use htmldoc. So it > will have to output the result sent to the browser also to the filesystem. > (Tee'd.) The above recipe also shows how to do this. Luiz Fernando B. Ribeiro Engenho Solu��es para a Internet +55 11 4485-0136 --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org For additional commands, e-mail: embperl-help@perl.apache.org