@@ -0,0 +1,2803 @@
+package at.ac.tuwien.inso.view.pdf;%0A%0Aimport com.lowagie.text.Chunk;%0Aimport com.lowagie.text.Document;%0Aimport com.lowagie.text.FontFactory;%0Aimport com.lowagie.text.Paragraph;%0Aimport com.lowagie.text.pdf.PdfWriter;%0A%0Aimport org.springframework.web.servlet.view.document.AbstractPdfView;%0A%0Aimport java.util.Map;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport at.ac.tuwien.inso.entity.Grade;%0A%0A%0Apublic class GradePDFView extends AbstractPdfView %7B%0A%0A    @Override%0A    protected void buildPdfDocument(Map%3CString, Object%3E map,%0A                                    Document document,%0A                                    PdfWriter pdfWriter,%0A                                    HttpServletRequest httpServletRequest,%0A                                    HttpServletResponse httpServletResponse) throws Exception %7B%0A%0A        Grade grade = (Grade) map.get(%22grade%22);%0A        String validationLink = (String) map.get(%22validationLink%22);%0A%0A        Paragraph header = new Paragraph(new Chunk(generateHeaderString(grade), FontFactory.getFont(FontFactory.HELVETICA, 30)));%0A        Paragraph note = new Paragraph(new Chunk(generateNoteString(grade), FontFactory.getFont(FontFactory.HELVETICA, 30)));%0A        Paragraph validation = new Paragraph(new Chunk(generateValidationString(validationLink), FontFactory.getFont(FontFactory.HELVETICA, 20)));%0A%0A%0A        document.add(header);%0A        document.add(note);%0A        document.add(validation);%0A%0A    %7D%0A%0A    private String generateHeaderString(Grade grade) %7B%0A        StringBuilder stringBuilder = new StringBuilder();%0A        stringBuilder.append(grade.getStudent().getName());%0A        stringBuilder.append(%22 actively participated in the course %22);%0A        stringBuilder.append(grade.getCourse().getSubject().getName());%0A        stringBuilder.append(%22 in %22);%0A        stringBuilder.append(grade.getCourse().getSemester().getLabel());%0A        stringBuilder.append(%22%22);%0A%0A        return stringBuilder.toString();%0A    %7D%0A%0A    private String generateNoteString(Grade grade) %7B%0A        StringBuilder stringBuilder = new StringBuilder();%0A        stringBuilder.append(%22 and was graded with %22);%0A        stringBuilder.append(grade.getMark());%0A        stringBuilder.append(%22 by %22);%0A        stringBuilder.append(grade.getLecturer().getName());%0A        return stringBuilder.toString();%0A    %7D%0A%0A    private String generateValidationString(String validationLink) %7B%0A        StringBuilder stringBuilder = new StringBuilder();%0A        stringBuilder.append(%22This is an automatically generated document. %22);%0A        stringBuilder.append(%22The document is valid without a signature. %22);%0A        stringBuilder.append(%22To validate the document, please go to: %22);%0A        stringBuilder.append(validationLink);%0A        return stringBuilder.toString();%0A    %7D%0A%7D%0A

Add the pdf generator