1. Target
Generate a table of variable headers in a PDF and populate it with data. Dynamically generated tables are achieved by dynamically acquiring data through a get method that dynamically gets the entity class (which I am the user) through a generic dynamic generation header.
Generate a folder every day to store the generated PDF file (the name of the folder is the date timestamp), such as: 20151110
The resulting file may be in the millisecond level, so the file naming convention is "timestamp-uuid to milliseconds", such as: 20151110100245690-ece540e5-7737-4ab7-b2d6-87bc23917c8c.pdf
Gets the file store's following directory dynamically by reading the properties file. Get ways to view: http://www.cnblogs.com/0201zcr/p/4700418.html
2. Required Jar
Here, the PDF is generated via the Itex plugin, and the required jar includes the following
3. Code implementation
1), Entity class
2), properties file
3), read the properties file, get the path of PDF storage
4), get the file path that exists on the current day, create a new folder if it does not exist
5), the name of the generated file
6), generate PDF
7), evaluation function
8), test results
9), the contents of the document are as follows
4. Other RELATED LINKS
Generate Variable Header excel:http://www.cnblogs.com/0201zcr/p/4950619.html
Read excel:http://www.cnblogs.com/0201zcr/p/4656779.html
170120. How Java generates tables in PDF