displaying pdf from memory....

G

Guest

I have a pdf that is contained in a byte[] array in memory and I want to
display this in a browser window.
The window will beopenned when a button is clicked on the current web page,
i.e. a second browser window is displayed, preferably with no menu or tool
bars....


Cheers

Jim
 
R

Rob Tillie

You could write it to a temp file and then execute it, it will then
automatically be opened with the default application for that file extension
(e.g. acrobat).

Greetz,
-- Rob.
 
D

dsandor

Try this on the page that loads in the new browser.

Response.ContentType = "application/pdf"

Response.BinaryWrite( yourPDFByteArray )

Response.End

(Make sure that you remove ALL the HTML tags from the ASPX page or they will
get appended to the end of the file, corrupting it.)

David Sandor
 
R

Rob Tillie

Didn't notice at first that it was a web app :S.
What DSandor is saying is right.
Moreover, for opening it in a popup, you'll have to use javascript I guess.
The simplest way I think is to open a popup window ( you can give params
here to not display the toolbar etc.), and then reassign the target from the
form that's going to be submitted to the popup window.

Greetz,
-- Rob.

Rob said:
You could write it to a temp file and then execute it, it will then
automatically be opened with the default application for that file
extension (e.g. acrobat).

Greetz,
-- Rob.
I have a pdf that is contained in a byte[] array in memory and I want
to display this in a browser window.
The window will beopenned when a button is clicked on the current web
page, i.e. a second browser window is displayed, preferably with no
menu or tool bars....


Cheers

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top