Creating a printable report simply, rtf or PDF



Any thoughts in the newsgroup?

Over Christmas I produced, using PHP and MySQL, a database and front end to
record my familys family tree with a short biography and linked photos and
locations if desired. All this works fairly well.

However, as a followup I'd like to create a report this data as a report (or
booklet) in printed format. The simplest and probably least satisfactory
way is to format it in very simple HTML and import it into the word
processor of choice.

Better ways I assume are to export it in PDF or RTF. I am veering toward
RTF.

PDF - pros:

Probably the neatest solution from a user point of view.


PDF - cons:

PHP was not compliled on my Slackware 10.0 linux system with the pdf
functions working.

My parents are running XP home, I doubt if phpdev5 (beta) has the same pdf
functions compliled in.

Basically I don't want to go through the rigmarole of recompiling php on two
dissimilar systems.

I could generate XLS-FO directly, then use FOP to generate PDF. I would
probably spend a lot of time getting this to work under two separate
systems, and have to get java working on XP. Hastle if I am not all that
familiar with java.

I could create a DTD, get my script to produce XML and then use a template
and something like sablotron to generate XML. That seems like a
sledgehammer to crack a nut. Also, I must be getting the wrong end of the
stick with XML, as last time I tried it created far far more work than it
saved. Saving effort seems to be a large point of XML.


RTF - pros:

Since this is basically one step from hand coding, using my script to
directly generate rtf is relatively self contained and therefore not
dependent on successfully installing a lot of other stuff.

RTF - cons:

I've still not managed to add images to RTF.

RTF is horrid, wrt to human readability of what my scripts are generating,
making debugging rather nasty.

Even if it works now in open office and word I have no way of knowing I have
not created broken RTF that future word processors might balk at.

Any thoughts?

Pete




--
http://www.petezilla.co.uk
.



Relevant Pages

  • Re: From XML to HTML and PDF
    ... XML to PDF searching turns up FOP, ... HTML version of my TOS document is actually PHP and does a straight conversion ...
    (comp.lang.java.programmer)
  • Re: Convert .rtf or .doc or .pdf or .htm to plain txt
    ... Does anybody know of code examples on how to convert RTF to HTML, XML etc? ... > But for PDF check out the pdftotext.exe from the XPDF library ... > It's a commandline tool so you would need to shell out to it, ...
    (microsoft.public.dotnet.framework)
  • Re: PDF extensions to php?
    ... I will probably want not to make the final output a file, but to dump it to either 'stdout' as part of a downloadable PDF, or to send it as an output stream to either a mail program, or a print queue. ... In none of these cases is an actual real file required..but as far as I can tell the php 'resource' that constitutes the actual PDF entity is not a text string..or is it? ... I'd be interested in a little more detail about which libraries you installed so I can see what they do. ... I created a builder class that processed the traversal of a data structure and used the xml writer class to generate the xml files. ...
    (comp.lang.php)
  • Re: Creating a printable report simply, rtf or PDF
    ... There are a few RTF generators available there, ... > Better ways I assume are to export it in PDF or RTF. ... > and something like sablotron to generate XML. ...
    (comp.lang.php)
  • Re: Report writing in PHP - what tools for making formating nice?
    ... > A client of mine wants to start generating some reports from their PHP / ... But due to the dynamic nature of the reports and what is ... You can generate reports in either PDF or RTF. ... The exact approach to generating PDF would depend on what PDF ...
    (comp.lang.php)