Sounds like the sort of thing covered in the API, did you check?
Joined: Jul 04, 2004
From the API..
public void addHeader(java.lang.String name, java.lang.String value) Adds a response header with the given name and value. This method allows response headers to have multiple values. Parameters: name - the name of the header value - the additional header value
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com