Return tiff file from outputstream on JSP
- by YYY
I am using a JSP to display a single TIFF file. The flow is as follows:
I am given a PDF to convert to a TIFF.
I feed a 'black box' API the PDF in the form of a File object and an OutputStream (I am currently using a ByteArrayOutputStream but that can change as needed.
The 'black box' converts the PDF to a TIFF and saves the result to the OutputStream.
I use out.println(outputstream) to spit out the TIFF.
The problem is that I am getting a text stream instead of a displayed image. I have used the following head/meta tag:
<head><title>PDF to TIFF tester</title>
<META HTTP-EQUIV="Content-Script-Type" CONTENT="image/tiff"></head>
<body>
But that does not change the end result. Any help?