HttpServletResponse response) throws IOException {
PaymentsManagementDTO managementDTO =
(PaymentsManagementDTO) RenderUtils.getViewState("paymentsManagementDTO").getMetaObject().getObject();
final GuideDocument document = new GuideDocument(managementDTO, getMessageResourceProvider(request));
final 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;