[Catalyst] Empty pdf file/ using Catalyst::View::PDF::Reuse
Lupin Deterd
lupindeterd at gmail.com
Sat Mar 6 08:51:36 GMT 2010
Hi,
I'm using View::PDF::Reuse to create/generate pdf, and though it
successfully create one but it's empty, following is code/template.
-- code --
{
$c->stash->{list} = ['one', 'two', 'three', 'four'];
$c->stash->{pdf_disposition} = 'attachment';
$c->stash->{pdf_filename} = 'receipt.pdf';
$c->stash->{pdf_template} = 'order/receipt.tt2';
$c->detach( $c->view('PDF::Reuse') );
}
-- template/receipt.tt2 --
[% pdf.prFont('Helvetica-Bold') %]
[% pdf.prFontSize(50) %]
[% y = 500 %]
[% FOREACH item IN list %]
[% pdf.prText(100,y,item) %]
[% y = y - 13 %]
[% END %]
Thanks in advance for any hints.
lupin
More information about the Catalyst
mailing list