Itext (i think it is on source forge) is a pdf API that isn't too bad to
use. IText is the jar files that Jasper reports uses to create it's PDF
reports.
To make the link downloadable when you click it you need to make the
link give a post/get request that tells it to send the result as a stream.
<begin crappy code example>
res.setContentType("application/pdf");
ServletOutputStream out = res.getOutputStream();
PDFWriter writer = new PDFWriter(action, type, ideas);
try {
writer.generateDocument(out);
} catch (DocumentException e) {
System.err.println("ARRGGGHH");
}
out.close();
</crappy code example>
Ok before that scares anybody :) this bit of code was from a quick
experimental spike from a project and this code was never really
developed (so it is a bit dirty (but it works).
The PDFWriter Object is the the actual JavaBean that creates the PDF
document (it is really, really ugly in there).
So what happens here is that I set my response content type to be a
"application/pdf", this tells my browser that the garbage of text coming
up is of course a PDF document.
I then write the PDF as a stream onto the response stream of the servlet.