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

[521 byte] By [RengaScreen] at [2007-11-26 11:30:30]
# 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.

mczapski at 2007-7-7 3:46:14 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 2

Hi,

The external application which explained also developed in JCAPS.So I just will invoke the external application.This external application will provide the ByteStream as o/p and needs to be displayed into browser as PDF on the fly.

But you have expalined with three option if I am using eVision page,I need to provide the URL of the PDF.If the PDF is already stored as file ,then I can provide the URL.But in my case it will display the ByteSteream on the fly itself to the browser.

Correct me if I am wrong..

Thanks,

Renga.S.

RengaScreen at 2007-7-7 3:46:14 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 3

In this case create a java collaboration that uses a HTTP Server eWay as

input. Have the collaboration obtain the PDF stream and populate the

body of the http response with the content of the PDF stream and set the

response content-type header to application/PDF. Use the URL that the

collaboration listens on as the url to get the PDF.

mczapski at 2007-7-7 3:46:14 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...