How can I create a PDF from a JSP using the PDF library (not the Report Generator)?
It is not recommended to create PDF’s from JSPs. JSP’s are intended to return text only, not binary content like PDF’s or images (for which you should use a Servlet). In more detail, a JSP page only has access to the PrintWriter, not the ServletOutputStream, so your response will be dependent on the encoding of the page. In addition, any newlines or spaces in your JSP will be inserted into your PDF, which as it’s a binary file is not a good idea. We’re not saying it can’t be done if you know what you’re doing and you’re careful, but whether it will work will depend on the browser, your application server and the environment it’s running in – so we don’t support it.