To send the response as a pdf, you would first need to generate a PDF. Try a Google search for "Apache FOP" or "itext" to find some libraries for generating PDFs.
Itext is memmory centric. If memmory is a constraint FOP is a beeter choice. iText is easy to configure and use. For bigger applications FOP is prefered.
Another tool is FDF toolkit. Which also have limitations.
Don't get me started about those stupid light bulbs.