[Solved] creating pdf file for download in java web [closed]
[ad_1] Why not just use DownloadLink with a Model that will generate the file? IModel fileModel = new LoadableDetachableModel (){ protected Object load() { // A hello world PDF File f = File.createTempFile(“tempFile”, null); Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream(f)); document.open(); document.add(new Paragraph(“Hello World!”)); document.close(); return f; } }; DownloadLink link = new … Read more