I think you can do this in a similar way that I created a image/thumbnail generator.
What I did was write a PhaseListener, and if the URL was of the right format the PhaseListener would take over and setup the response with the right content type. After writing the data to the response you just call FacesRequest.responseComplete().
Just curious did you implement it as a PhaseListener? Or did you find another approach?