Finding the right API to do the heavy work
PDF is a complex format created to display documents. It supports texts, graphics and a whole set of features, and has an 747 pages specification that can be bought here: ISO 32000-1 specification. One does not simply start writing to a PDF file, as unlike a text file, they usually contain non-ASCII binary characters and should always be considered as binary files.
Using an off the shelf API can greatly reduce the burden of trying to do that kind of file creation or modification manually. After some quick research I've realized that most o the available libs on the web were paid. The most used standard is iText, which needs a commercial license if being used for commercial purposes (http://itextpdf.com/salesfaq) The best free solution I found was PDFBox, which immediately drew my attention for being an Apache project. It is currently on the 1.8.4 release, is stable and has a fairly extensive amount of documentation on it's website and forums.
Now the thing is, I went through mailing lists and documentation and it doesn't come with any ready-made feature for tables generation. That requires for the developer to handle the drawing of the table's columns and rows. The following code performs that task and also handles paginating the table to multiple pages in case it doesn't fit.
Output sample: