[Catalyst] Template::Latex in Catalyst

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Wed Nov 8 18:56:38 GMT 2006







Yves Räber <yraber at mailup.net> wrote on 11/08/2006 12:33:09 PM:

> Hi,
>
> I'm trying to use Template::Latex to create PDF files.
>
> My code looks like this :
>
>     use Template::Latex;
>
>     my $tt = Template::Latex->new({
>         INCLUDE_PATH  => '/templates',
>         OUTPUT_PATH   => '/tmp/pdf'
>         LATEX_FORMAT  => 'pdf',
>     });
>
>     my $vars = {
>         title => 'Hello World',
>     }
>     my $output;
>
>    $tt->process('example.tt2', $vars, \$output, binmode => 1)
>       || die $tt->error();
>
> This works fine in a standalone application, but when I copy this code
into by
> Catalyst Controller it behaves otherwise, there is no output at all, and
no
> error or warning message even when using Template debug options (the
$output
> variable keeps empty)
>
> I also tried with a filename in the third parameters of the 'process'
method
> and I get the same result : works fine in standalone application (I get
my
> nice PDF in the output path), but no file gets created when run in the
> catalyst controller.
>
> Maybe I'm missing something really obvious, but right now I have no idea
what
> to do to make it work.
>
> Did anyone tried to do the same thing with success ?
>
> Thank you.Catalyst at lists.rawmode.org
>
> Yves Raber
>

Maybe it is having issues finding the binaries needed to do the
conversions:

Template::Latex->latex_paths({
        latex    => '/usr/bin/latex',
        pdflatex => '/usr/bin/pdflatex',
        dvips    => '/usr/bin/dvips',
    });





More information about the Catalyst mailing list