Whats the correct way to obtain the input/ouput streams for the convert method? The html is generated dynamically from jsp's. I'm trying to capture the response befor sending it and then converting it to PDF.
HttpServletResponse httpResponse = (HttpServletResponse) (response);
responseWrapper = Response.getResponse(httpResponse);
ByteArrayInputStream bais = new ByteArrayInputStream(responseWrapper.getData());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
convert(bias,baos)
outputBytes = baos.toByteArray();
...setting content type headers
then:
OutputStream outStream = httpResponse.getOutputStream()
outStream.write(outputBytes);
outStream.flush();
The convert method's return status is true and I can write a PDF file to disk
from the baos. Can't output the contents to the browser
thanks
HttpServletResponse httpResponse = (HttpServletResponse) (response);
responseWrapper = Response.getResponse(httpResponse);
ByteArrayInputStream bais = new ByteArrayInputStream(responseWrapper.getData());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
convert(bias,baos)
outputBytes = baos.toByteArray();
...setting content type headers
then:
OutputStream outStream = httpResponse.getOutputStream()
outStream.write(outputBytes);
outStream.flush();
The convert method's return status is true and I can write a PDF file to disk
from the baos. Can't output the contents to the browser
thanks