public ActionForward printApprovalDocument(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) throws Exception {
Thesis thesis = getThesis(request);
try {
ApproveJuryDocument document = new ApproveJuryDocument(thesis);
byte[] data = ReportsUtils.exportToProcessedPdfAsByteArray(document);
response.setContentLength(data.length);
response.setContentType("application/pdf");
response.addHeader("Content-Disposition", String.format("attachment; filename=%s.pdf", document.getReportFileName()));
response.getOutputStream().write(data);
return null;
} catch (Exception e) {
addActionMessage("error", request, "coordinator.thesis.approved.print.failed");