Displaying the PDF ByteStream on to the browser?
Hi,
I want to display a pdf on the browser.
I have with me the byte stream, using which I need to display the pdf
directly on the browser.
Currently, I am storing it in my local file system by creating a file
output stream. But its taking a lot of time.
I don't want to create any intermediate files.
Is it possible to display the PDF directly on the browser?
If yes, then can some one point how can this be achieved in SunSeeBeyond......
Regards,
Renga
# 1
The questions really are
1."how do I get the web browser to GET a PDF data stream from SeeBeyond"
2."how do I return a PDF data stream from SeeBeyond so that the browser
interprets it as PDF".
Question 2.
PDF data can be supplied to the browser the same as any other content.
Content-type header will be application/pdf - see RFC3778
If your "web application" is completely outside Java CAPS but you need
Java CAPS to provide the PDF data then the simplest thing to do is to
develop a JCD or a BP that uses the HTTP Server eWay, accepts the GET
request, gets the data, sets the data in the HTTP Response, sets the
content-type in the HTTP Response and sends the lot back to the browser.
If you are using eVision then you need to consider where within your
eVision page you would like to display the PDF. A couple of choices are
a) in a popup window, b) in an inline frame, c) in an independent
browser window. In all of these you can specify the URL of the PDF and
the browser will send the GET request to whatever provides the PDF data,
Java CAPS or otherwise. All this has plenty to do with HTTP, HTML and
client-side scripting and rather little to do with Java CAPS. If you
don't understand these underlying technologies you will have
difficulties working out by yourself what can/needs be done.
Question 1.
Again, if your "web application" is developed outside Java CAPS you
cause the link, button, or some such, to get the web browser to issue a
HTTP GET request with the appropriate URL that points to the Java CAPS
infrastructure component that will return the PDF data with the
appropriate HTTP Headers. If your application is eVision-based then
again you need to consider where the PDF content is to be displayed and
get the eVision page to issue the GET request for you, have the pageflow
construct the eVision page so that it embeds the PDF, etc., etc..
All of this is well beyond a simple answer to a simple question. This
takes time to analyse and respond so don't expect a cookbook answer from
anyone.