My first try on using XSL-FO.
XSL-FO (or XSL) is a XML-based language to format data for output on paper. It is like CSS but for paper. The attachments are my first trivial trial on the matter.
I used Apache FOP to transform the HelloWorld.fo file into HelloWorld.pdf. It only requires JRE 1.2.x or later, and there is no installation. Just extract Apache FOP into a directory, copy my HelloWorld.fo to this directory, fire up a Cygwin Bash (or a ”normal” command prompt), change directory to where you installed FOP and write:
./fop.bat HelloWorld.fo HelloWorld.pdf
FOP will generate the pdf in the same directory.
The example is in A4 format, but can easily be changed to US Letter by changing the page-height and page-width in the simple-page-master.