Mailing List Archive

How create a PDF report?
Hi, I'm been using Catalyst recently to make a little application and
I want to create a PDF report, I have it using TT, Is there a way to
make it in PDF format?. I was reading the documentation but I didn't
found (or maybe didn't see ) something about that, I also search in
CPAN but I didn't see some module or plugin for this. How can I do
this? Is there a module or documentation about this?.

Thanks.

--
Christian Sánchez
Usuario GNU/Linux 234800
Jabber ID: g013m@bulmalug.net
Maracay - Venezuela
http://g013m.unplug.org.ve

_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
Christian Sánchez wrote:
> Hi, I'm been using Catalyst recently to make a little application and
> I want to create a PDF report, I have it using TT, Is there a way to
> make it in PDF format?. I was reading the documentation but I didn't
> found (or maybe didn't see ) something about that, I also search in
> CPAN but I didn't see some module or plugin for this. How can I do
> this? Is there a module or documentation about this?.
>
> Thanks.
>

One option is to make an alternative TT template that outputs XSL-FO*,
and then use Apache FOP to transform that into PDF. That works quite
well and produces nice PDFs, but might be a bit heavy-weight if you're
only looking to make one thing.

[.*: Or, output XML, and then do an XSLT->XSL-FO transformation prior to
continuing with FOP.]

_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
Christian Sánchez wrote:
> Hi, I'm been using Catalyst recently to make a little application and
> I want to create a PDF report, I have it using TT, Is there a way to
> make it in PDF format?. I was reading the documentation but I didn't
> found (or maybe didn't see ) something about that, I also search in
> CPAN but I didn't see some module or plugin for this. How can I do
> this? Is there a module or documentation about this?.

Have you looked at PDF::Template?

--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
catalyst-bounces@lists.rawmode.org wrote on 06/08/2006 09:23:10 AM:

> Christian Sánchez wrote:
> > Hi, I'm been using Catalyst recently to make a little application and
> > I want to create a PDF report, I have it using TT, Is there a way to
> > make it in PDF format?. I was reading the documentation but I didn't
> > found (or maybe didn't see ) something about that, I also search in
> > CPAN but I didn't see some module or plugin for this. How can I do
> > this? Is there a module or documentation about this?.
>
> Have you looked at PDF::Template?
>

Or if you are comfortable with Latex...

http://search.cpan.org/~andrewf/Template-Latex-2.16/lib/Template/Latex.pm



_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
On 6/8/06, Wade.Stuart wrote:

> >
> > Have you looked at PDF::Template?
> >
>
> Or if you are comfortable with Latex...
>
> http://search.cpan.org/~andrewf/Template-Latex-2.16/lib/Template/Latex.pm
>

Thanks all for the recomendations, I will check these modules.

Regards.


--
Christian Sánchez
Usuario GNU/Linux 234800
Jabber ID: g013m@bulmalug.net
Maracay - Venezuela
http://g013m.unplug.org.ve

_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
On Jun 8, 2006, at 6:31 AM, Toby Corkindale wrote:

> Christian Sánchez wrote:
>> Hi, I'm been using Catalyst recently to make a little application and
>> I want to create a PDF report, I have it using TT, Is there a way to
>> make it in PDF format?. I was reading the documentation but I didn't
>> found (or maybe didn't see ) something about that, I also search in
>> CPAN but I didn't see some module or plugin for this. How can I do
>> this? Is there a module or documentation about this?.
>>
>> Thanks.
>>
>
> One option is to make an alternative TT template that outputs XSL-FO*,
> and then use Apache FOP to transform that into PDF. That works quite
> well and produces nice PDFs, but might be a bit heavy-weight if you're
> only looking to make one thing.
>
> [.*: Or, output XML, and then do an XSLT->XSL-FO transformation
> prior to
> continuing with FOP.]

I'm doing this from perl using XML::ApacheFOP, which uses Java.pm to
communicate between perl and a persistent jvm instance and it works
very, very nicely. FOP allows embedded images in SVG as well as vector
formats, so it'll do basic graphs nicely too.

Cheers,
Steve


_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
Christian Sánchez wrote:
> Hi, I'm been using Catalyst recently to make a little application and
> I want to create a PDF report, I have it using TT, Is there a way to
> make it in PDF format?. I was reading the documentation but I didn't
> found (or maybe didn't see ) something about that, I also search in
> CPAN but I didn't see some module or plugin for this. How can I do
> this? Is there a module or documentation about this?.
>
> Thanks.
>

Another possibility is to use Jasperreports called via Java::Inline.

Regards, Peter



_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
No one seems to have mentioned htmldoc yet, which you can simply pass a
URL and the filename to output. Not all perly, but a simple solution if
this is is just a little application.

alan

On Thu, Jun 08, 2006 at 09:24:33AM -0400, Christian S?nchez wrote:
> Hi, I'm been using Catalyst recently to make a little application and
> I want to create a PDF report, I have it using TT, Is there a way to
> make it in PDF format?. I was reading the documentation but I didn't
> found (or maybe didn't see ) something about that, I also search in
> CPAN but I didn't see some module or plugin for this. How can I do
> this? Is there a module or documentation about this?.
>
> Thanks.
>
> --
> Christian S?nchez
> Usuario GNU/Linux 234800
> Jabber ID: g013m@bulmalug.net
> Maracay - Venezuela
> http://g013m.unplug.org.ve
>
> _______________________________________________
> Catalyst mailing list
> Catalyst@lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst

--
Alan <alan@ufies.org> - http://arcterex.net
--------------------------------------------------------------------
"Backups are for people who don't pray." -- big Mike

_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
Wade.Stuart@fallon.com wrote:
> catalyst-bounces@lists.rawmode.org wrote on 06/08/2006 09:23:10 AM:
>
>
>> Christian Sánchez wrote:
>>
>>> Hi, I'm been using Catalyst recently to make a little application and
>>> I want to create a PDF report, I have it using TT, Is there a way to
>>> make it in PDF format?. I was reading the documentation but I didn't
>>> found (or maybe didn't see ) something about that, I also search in
>>> CPAN but I didn't see some module or plugin for this. How can I do
>>> this? Is there a module or documentation about this?.
>>>
>> Have you looked at PDF::Template?
>>
> Or if you are comfortable with Latex...
>
> http://search.cpan.org/~andrewf/Template-Latex-2.16/lib/Template/Latex.pm
>
Note that Template-Latex currently only runs latex (or pdflatex) once on
the source, which means that features like table of contents and
forward references, which require repeated runs, will not work, neither
will it run bibtex or makeindex, so you don't get bibliographies or an
index. That said pdflatex can generate very nice PDFs -- I have
typeset an illustrated cookery book with LaTeX, generating camera ready
copy that was used directly by our publisher's printers, and we also
generate nicely typeset price lists with Catalyst, DBI and TT2.

I have just taken over as maintainer of the module and will be adding
functionality (that I had as a patch to an earlier version of TT2) to
run bibtex and makeindex if it is detected that they are needed, and to
re-run latex to resolve forward references and table of contents. I
hope to have a new version out in a week or so which will be "all
singing and dancing".

Regards
Andrew

--
Andrew Ford, Director Pauntley Prints / Ford & Mason Ltd
A.Ford@ford-mason.co.uk South Wing Compton House
pauntley-prints.co.uk Compton Green, Redmarley Tel: +44 1531 829900
ford-mason.co.uk Gloucester GL19 3JB Fax: +44 1531 829901
refcards.com cronolog.org Great Britain Mobile: +44 7785 258278



_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
+----[ Andrew Ford <A.Ford@ford-mason.co.uk> (09.Jun.2006 07:41):
|

[snipped]

| >> Have you looked at PDF::Template?
| >>
| > Or if you are comfortable with Latex...
| >
| > http://search.cpan.org/~andrewf/Template-Latex-2.16/lib/Template/Latex.pm
| >
| Note that Template-Latex currently only runs latex (or pdflatex) once on
| the source, which means that features like table of contents and
| forward references, which require repeated runs, will not work, neither
| will it run bibtex or makeindex, so you don't get bibliographies or an
| index.

Mmm ... maybe Template-Latex can be changed to run latexmk
instead of pdflatex?

http://www.phys.psu.edu/~collins/software/latexmk-jcc/

latexmk is a wrapper and will run "LaTeX the correct number
of times to resolve cross references, etc; it also runs
auxiliary programs (bibtex, makeindex if necessary, ..."

I know that this brings another dependency ... but

i) latexmk is a single script.

ii) it's written in Perl

iii) it only depends on LaTeX (of course) and a few basic
perl modules (all bundled with Perl, AFAIK, no need to
install them separately)

iv) it is licensed under GNU-GPL v2

v) it knows how to deal with different OSs to get
information about files that have changed (for example an
.aux file) and decide if latex has to be run again

Given the above, it would not be too farfetched to think of
using latexmk as an external dependency or including the
functionality (at least the relevant pieces) of latexmk into
Template-Latex ... sounds attractive? doable?

| That said pdflatex can generate very nice PDFs -- I have
| typeset an illustrated cookery book with LaTeX, generating camera ready
| copy that was used directly by our publisher's printers, and we also
| generate nicely typeset price lists with Catalyst, DBI and TT2.
|
| I have just taken over as maintainer of the module and will be adding
| functionality (that I had as a patch to an earlier version of TT2) to
| run bibtex and makeindex if it is detected that they are needed, and to
| re-run latex to resolve forward references and table of contents. I
| hope to have a new version out in a week or so which will be "all
| singing and dancing".
|
| Regards
| Andrew
|
+----]

Check latexmk. It's been doing exactly this for quite a
while now, and has already been stress tested by many latex
users (the algorithm for deciding how many times to run
latex has evolved, based on feedback from users).

Even if you decide not to use it, taking a look at how it
does its job might save you some time :)

Cheers,

Fernan

_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? (suggestion for Template-Latex) [ In reply to ]
Thanks for that information. I have just had a look at latexmk -- I
don't think I want to add it as a dependency, especially as latexmk is a
3,800 line script, and aspects such as dealing with previewers are
irrelevant in the Template Toolkit plugin environment. However I will
look closely at what the script does -- especially the logic for
determining the logic for determining the minimum set of actions that
need to be performed.

Regards
Andrew

Fernan Aguero wrote:
> +----[ Andrew Ford <A.Ford@ford-mason.co.uk> (09.Jun.2006 07:41):
> |
>
> [snipped]
>
> | >> Have you looked at PDF::Template?
> | >>
> | > Or if you are comfortable with Latex...
> | >
> | > http://search.cpan.org/~andrewf/Template-Latex-2.16/lib/Template/Latex.pm
> | >
> | Note that Template-Latex currently only runs latex (or pdflatex) once on
> | the source, which means that features like table of contents and
> | forward references, which require repeated runs, will not work, neither
> | will it run bibtex or makeindex, so you don't get bibliographies or an
> | index.
>
> Mmm ... maybe Template-Latex can be changed to run latexmk
> instead of pdflatex?
>
> http://www.phys.psu.edu/~collins/software/latexmk-jcc/
>
> latexmk is a wrapper and will run "LaTeX the correct number
> of times to resolve cross references, etc; it also runs
> auxiliary programs (bibtex, makeindex if necessary, ..."
>
> I know that this brings another dependency ... but
>
> i) latexmk is a single script.
>
> ii) it's written in Perl
>
> iii) it only depends on LaTeX (of course) and a few basic
> perl modules (all bundled with Perl, AFAIK, no need to
> install them separately)
>
> iv) it is licensed under GNU-GPL v2
>
> v) it knows how to deal with different OSs to get
> information about files that have changed (for example an
> .aux file) and decide if latex has to be run again
>
> Given the above, it would not be too farfetched to think of
> using latexmk as an external dependency or including the
> functionality (at least the relevant pieces) of latexmk into
> Template-Latex ... sounds attractive? doable?
>
> | That said pdflatex can generate very nice PDFs -- I have
> | typeset an illustrated cookery book with LaTeX, generating camera ready
> | copy that was used directly by our publisher's printers, and we also
> | generate nicely typeset price lists with Catalyst, DBI and TT2.
> |
> | I have just taken over as maintainer of the module and will be adding
> | functionality (that I had as a patch to an earlier version of TT2) to
> | run bibtex and makeindex if it is detected that they are needed, and to
> | re-run latex to resolve forward references and table of contents. I
> | hope to have a new version out in a week or so which will be "all
> | singing and dancing".
> |
> | Regards
> | Andrew
> |
> +----]
>
> Check latexmk. It's been doing exactly this for quite a
> while now, and has already been stress tested by many latex
> users (the algorithm for deciding how many times to run
> latex has evolved, based on feedback from users).
>
> Even if you decide not to use it, taking a look at how it
> does its job might save you some time :)
>
> Cheers,
>
> Fernan
>

--
Andrew Ford, Director Pauntley Prints / Ford & Mason Ltd
A.Ford@ford-mason.co.uk South Wing Compton House
pauntley-prints.co.uk Compton Green, Redmarley Tel: +44 1531 829900
ford-mason.co.uk Gloucester GL19 3JB Fax: +44 1531 829901
refcards.com cronolog.org Great Britain Mobile: +44 7785 258278



_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
catalyst-bounces@lists.rawmode.org wrote on 06/09/2006 05:37:04 AM:

> Wade.Stuart@fallon.com wrote:
> > catalyst-bounces@lists.rawmode.org wrote on 06/08/2006 09:23:10 AM:
> >
> >
> >> Christian Sánchez wrote:
> >>
> >>> Hi, I'm been using Catalyst recently to make a little application and
> >>> I want to create a PDF report, I have it using TT, Is there a way to
> >>> make it in PDF format?. I was reading the documentation but I didn't
> >>> found (or maybe didn't see ) something about that, I also search in
> >>> CPAN but I didn't see some module or plugin for this. How can I do
> >>> this? Is there a module or documentation about this?.
> >>>
> >> Have you looked at PDF::Template?
> >>
> > Or if you are comfortable with Latex...
> >
> > http://search.cpan.org/~andrewf/Template-Latex-2.16
/lib/Template/Latex.pm
> >
> Note that Template-Latex currently only runs latex (or pdflatex) once on
> the source, which means that features like table of contents and
> forward references, which require repeated runs, will not work, neither
> will it run bibtex or makeindex, so you don't get bibliographies or an
> index. That said pdflatex can generate very nice PDFs -- I have
> typeset an illustrated cookery book with LaTeX, generating camera ready
> copy that was used directly by our publisher's printers, and we also
> generate nicely typeset price lists with Catalyst, DBI and TT2.
>
> I have just taken over as maintainer of the module and will be adding
> functionality (that I had as a patch to an earlier version of TT2) to
> run bibtex and makeindex if it is detected that they are needed, and to
> re-run latex to resolve forward references and table of contents. I
> hope to have a new version out in a week or so which will be "all
> singing and dancing".
>
> Regards
> Andrew

Thanks for the info! I have only ever used it for simple documents and
had never looked at doing TOC etc. it is good to know it is being
extended in these areas.


_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
catalyst-bounces@lists.rawmode.org wrote on 06/09/2006 05:37:04 AM:
>>>> Hi, I'm been using Catalyst recently to make a little application and
>>>> I want to create a PDF report, I have it using TT, Is there a way to
>>>> make it in PDF format?. I was reading the documentation but I didn't
>>>> found (or maybe didn't see ) something about that, I also search in
>>>> CPAN but I didn't see some module or plugin for this. How can I do
>>>> this? Is there a module or documentation about this?.
>>>>
>>>>
I did something similar a while back, I didn't know about Latex or any
other PDF generation method. Just used htmldoc to process the the html
output from TT:

... in your controller

# generate the html body
$c->forward( $c->view('TT') );

# write to tmp file as I couldn't get my version of htmldoc to work
correctly from STDIN
my $tmp = "/tmp/pdf_tmp.$$.html";
open F, ">$tmp" or die "Can't write: $!";
print F $c->res->body;
close F;

$c->res->header('Content-Type' => 'application/pdf');
$c->res->header('Content-Disposition' => qq[inline;
filename="$filename"]);
open PDF, '-|', (qw</usr/bin/htmldoc --quiet>, @args, qw<
--charset iso-8859-1 --footer .1. --size a4 --format pdf14
--portrait --size a4 --format pdf14 --portrait --webpage>, $tmp)
or die "Open: $!";

local $/;
my $out = <PDF>;
close PDF;

$c->res->body($out);
unlink $tmp;



-------------------

or something to that effect


_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
Re: How create a PDF report? [ In reply to ]
I'm using htmldoc for generating some pdf pages, but I now need to
generate labels. Anyone used/tried the PDF::Labels modules on CPAN?
(Seems like there's two with thes same name).

I need to print name tags (with graphics) and also generate sheet mailing
labels.



--
Bill Moseley
moseley@hank.org


_______________________________________________
Catalyst mailing list
Catalyst@lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst