use of com.lowagie.text.pdf.PdfAction in project qcadoo by qcadoo.
the class ReportPdfView method buildPdfDocument.
@Override
protected void buildPdfDocument(final Map<String, Object> model, final Document document, final PdfWriter writer, final HttpServletRequest request, final HttpServletResponse response) {
String fileName;
try {
PdfAction ac = PdfAction.gotoLocalPage(1, new PdfDestination(PdfDestination.XYZ, -1, -1, 1f), writer);
writer.setOpenAction(ac);
fileName = addContent(document, model, LocaleContextHolder.getLocale(), writer);
} catch (DocumentException e) {
throw new IllegalStateException(e.getMessage(), e);
} catch (IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}
response.setHeader("Content-disposition", "inline; filename=" + fileName.replaceAll(",", ".") + "." + ReportService.ReportType.PDF.getExtension());
}
Aggregations