PDFBox is a library to create PDF document on-the-fly. It offers a lot of feature to generate page, read existing pdf document text and draw on blank template.
This gist offers an example to generate a table in pdf document with PDFBox