private void addAppendix_B_PersonsListedByAge() throws DocumentException {
newPage();
PersonListSort.sortByAge(persons);
Paragraph paragraph = new Paragraph();
Chunk chunk = new Chunk("Anhang B\r\n", fontHelvetica18Bold);
Anchor anchor = new Anchor(chunk);
anchor.setName("anhang-b");
paragraph.add(anchor);
document.add(paragraph);
paragraph = new Paragraph();
chunk = new Chunk("\r\n" + ANHANG_B_VERSTORBENE_PERSONEN_SORTIERT_NACH_ALTER + "\r\n", fontHelvetica18BoldItalic);
paragraph.add(chunk);
document.add(paragraph);
long lastAge = Integer.MIN_VALUE;
for (Person person : persons) {
String birthday = person.getValueView(Person.BIRTHDAY);
long b = Statics.getYYYYMMDDlong(birthday);
String deathday = person.getValueView(Person.DEATHDAY);
long d = Statics.getYYYYMMDDlong(deathday);
if (b >= 0 && d >= 0) {
long currAge = (d - b) / 10000;
if (currAge != lastAge) {
paragraph = new Paragraph();
lastAge = currAge;
String header = "Alter: " + lastAge + " Jahre";
chunk = new Chunk("\r\n" + header + "\r\n", fontHelvetica12Bold);
paragraph.add(chunk);
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(" (" + person.getShortDate() + ")"));
document.add(paragraph);
}
}
}