macros14
asked on
PDF Open new window?
I finally got my application to work where on a blank page a pdf will open (the pdf is being brought out of a database as a ole object). The only problem I have having now is the fact that it opens in a acrobat window and leaves the ie window blank, so you have two windows open. How can I make it open within IE??
Here is my code.
If rd.Read() Then
Dim filename As String
Dim filesize As Integer
Dim contenttype As String
filename = rd.GetString(0)
filesize = rd.GetInt32(1)
contenttype = rd.GetString(2)
Dim filedata(filesize) As Byte
rd.GetBytes(3, 0, filedata, 0, filesize)
Response.Clear()
If (forceDownload) Then
Response.AppendHeader("Con tent-Dispo sition", "attachment; filename=" + filename)
Else
Response.AppendHeader("Con tent-Dispo sition", "inline; filename=" + filename)
End If
Response.ContentType = contenttype
Response.OutputStream.Writ e(filedata , 0, filedata.Length)
End If
rd.Close()
con.Close()
Here is my code.
If rd.Read() Then
Dim filename As String
Dim filesize As Integer
Dim contenttype As String
filename = rd.GetString(0)
filesize = rd.GetInt32(1)
contenttype = rd.GetString(2)
Dim filedata(filesize) As Byte
rd.GetBytes(3, 0, filedata, 0, filesize)
Response.Clear()
If (forceDownload) Then
Response.AppendHeader("Con
Else
Response.AppendHeader("Con
End If
Response.ContentType = contenttype
Response.OutputStream.Writ
End If
rd.Close()
con.Close()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As I understand, even that would open the pdf file in its own exe and not within the browser window ..
@Rejojohny,
I promise you, if you try the code you will see a pdf file inside your browser:o) It is so called browser's plug-in capability
I promise you, if you try the code you will see a pdf file inside your browser:o) It is so called browser's plug-in capability
how the pdf file should behave is configured in ur PC,
open explorer ..
in the menu tool->option->file types tab
seelct the pdf type .. click on advanced button .. u will see that "Open in the same window" is disabled .. if this was enabled, u could check it and then ur pdf will open in the same window as IE ..