Return tiff file from outputstream on JSP

Posted by YYY on Stack Overflow See other posts from Stack Overflow or by YYY
Published on 2010-05-13T17:50:21Z Indexed on 2010/05/13 17:54 UTC
Read the original article Hit count: 254

Filed under:
|
|
|
|

I am using a JSP to display a single TIFF file. The flow is as follows:

  1. I am given a PDF to convert to a TIFF.
  2. 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.
  3. The 'black box' converts the PDF to a TIFF and saves the result to the OutputStream.
  4. 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?

© Stack Overflow or respective owner

Related posts about jsp

Related posts about tiff