Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Streaming PDF

  1. #1
    Join Date
    Jun 2006
    Posts
    1

    Default Streaming PDF

    Hello everyone, I have a following question [I am not sure if this is appropriate place to ask it]. I need to stream .pdf file from database and open it up in the new browser window (without saving to the local HD). Can you give me any tips??? Thank you in advance! Mike

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hi,

    well, that's simple. From the database you get an input stream (assuming the PDF data is stored as BLOB), and all you have to do is to copy the stream from the database into the output stream you got from the HttpServletResponse-object.

    It is also wise to adjust the Content-Type header so that the browser can start the PDF plugin - and to include an Content-Disposition header if you want to control how the PDF is displayed. See RFC1945 for details on these headers.

    Whether a browser opens a new window cannot be controled from the servlet. You have to add a 'target="_new" ' attribute to the <a>-element that links to your servlet.

    Regards,
    Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.