# [erlang-questions] PDF reports from Mnesia: Erlguten and XMerL?

Roberto Aloi roberto.aloi@REDACTED
Fri Oct 9 12:05:30 CEST 2009

Hi Nina,

I had to automatically generate PDF around one year ago. After
struggling a bit with Erlguten, I found it a bit too "alpha".
My requirements were very different from yours, but this is what I did
at the end.

- I defined a new LaTeX template
- I reused some code from the wpart_gen.erl module contained in Erlang
Web to build a "file injector" (15 minutes job).
- Then I was able to do the following:

{ok, Title} = injector:inject("report.tex", [{"title", Title}]),

Where report.tex was my .tex file, looking like:

[...]
\author{Roberto Aloi}
\title{<% title %>}
\begin{center}
[...]

- Then I used the latex2pdf to generate the pdf file.

Again, this is far away from an optimal and/or efficient solution, but
it worked fine and it was quick!

Regards,

Roberto Aloi

Nina Alex Juliadotter wrote:
> Hi all
>
> I'm writing an app with a Mnesia backend that needs to generate PDF
> files from the data and was wondering if anyone had any tips on how to
> go about doing this.
>
> I've come across Erlguten for PDF generation, which takes XML files as
> input. So, to use Mnesia data, I take it I could use XMerL to
> transform it into XML? The only trouble is that both these projects
> seem rather idle and alpha like, the last time I've seen any
> discussions was in 2004 and the source I found is from 2003. Is anyone
> generating PDF files in their Erlang app, and in that case what
> libraries are you using?
>
> Thanks heaps
> Nina
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>