[thelist] PDF report generator

Mattias Thorslund mattias at thorslund.us
Mon Dec 26 21:00:12 CST 2005


Hi,

I'm looking for a way to reliably generate print-quality forms (filling
them in data from a database) from a layout template. Some of the forms
are pretty complicated-looking government issued forms (think tax forms)
that probably are best laid out with tables and merged cells. The
templates should be editable by non-programmers, so a WYSIWYG-type
editor is preferable.

Because the application I'm building is going to be distributed under an
open-source license, it is very much preferred that whatever software
the reporting piece uses be open-source as well.

My application is built in PHP and uses a MySQL database.

I have looked at a number of possible solutions but haven't found a
'perfect' solution so far. I thought Agata Reports [1] would be a great
template editor but it turned out to be not very WYSIWYG, seems best
suitable for list-style reports, and appears to require a live database
connection when building the templates.

Another idea was to use PDF documents that have fill-in forms, and
automatically populate the forms with data before serving them to the
user. I can't find an open utility that does this. Several commercial
tools do it however.

Making the templates in HTML and using some utility to convert them into
PDF seemed viable, until I tried a few converters. I was not very
impressed. Table rendering seems to be a problem in particular.

I found that the tools that geenerated the most elegant and
attractive-looking results were those that involved OpenOffice.org,
generating PDFs on the server, such as JooReports [2]. My hesitation
here is that JooReports is Java, and I'm using PHP. It should be
possible to use the PHP/Java bridge [3], but so far I've been having
some troubles getting Java to run on my system. I would also like to
avoid adding Java as an installation requirement for my application.

There are some OpenOffice.org tools made in PHP also, such as
"TinyButStrong OOo" [4], which uses a template language to insert data
in OOo documents, but apparently it does not include the functionality
to convert the OOo documents to PDF. It might be possible to use OOo's
Python or command-line interfaces to do that somehow, though I can't
locate any useful documentation on that topic.

Thoughts or feedback on any of the above would be greatly appreciated.

Mattias


Links referenced above:
[1] http://www.agata.org.br/
[2] http://jooreports.sourceforge.net/
[3] http://php-java-bridge.sourceforge.net/
[4] http://phpclasses.wehost4u.net/browse/package/2624.html






More information about the thelist mailing list