newPage();
PersonListSort.sortByBirthdayDayMonth(persons);
Paragraph paragraph = new Paragraph();
Chunk chunk = new Chunk("Anhang C\r\n", fontHelvetica18Bold);
Anchor anchor = new Anchor(chunk);
anchor.setName("anhang-c");
paragraph.add(anchor);
document.add(paragraph);
paragraph = new Paragraph();
chunk =
new Chunk("\r\n" + ANHANG_C_PERSONEN_SORTIERT_NACH_GEBURTSTAG_OHNE_JAHR + "\r\n", fontHelvetica18BoldItalic);
paragraph.add(chunk);
document.add(paragraph);
int lastDay = Integer.MIN_VALUE + 2;
int lastMonth = Integer.MIN_VALUE + 2;
for (Person person : persons) {
String birthday = person.getValue(Person.BIRTHDAY);
int currDay = person.getBirthDay();
int currMonth = person.getBirthMonth();
int currYear = person.getBirthYear(false);
if (currDay > 0 && currMonth > 0) {
if (lastDay != currDay || lastMonth != currMonth) {
paragraph = new Paragraph();
lastDay = currDay;
lastMonth = currMonth;
String header = lastDay + ". " + Statics.months[lastMonth - 1];
chunk = new Chunk("\r\n" + header + "\r\n", fontHelvetica12Bold);
anchor = new Anchor(chunk);
anchor.setName("dm-" + birthday.substring(0, birthday.lastIndexOf('.')));
paragraph.add(anchor);
document.add(paragraph);
}
paragraph = new Paragraph();
String fullname = person.getValue(Person.NAME);
if (createPrintVersion) {
fullname += " [" + (personsSorted.indexOf(person) + 1) + "]";
}
chunk = new Chunk(fullname, fontTimes12ItalicBlue);
anchor = new Anchor(chunk);
anchor.setReference("#p-" + person.getXREFID());
paragraph.add(anchor);
paragraph.add(new Chunk(" ("));
anchor = new Anchor(new Chunk(Integer.toString(currYear)));
anchor.setReference("#y-" + currYear);
paragraph.add(anchor);
paragraph.add(new Chunk(")"));
document.add(paragraph);
}
}