displaying pdf from memory....

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top