Hi John,
Here's the code:
HTML:
<div id="divPDF" style="VISIBILITY: hidden" runat="server">
<!--Note that without a relative src attribute, iframe will cause a
nonsecure item warning!-->
<iframe id="ifPDF" src="test.htm" width="100%" style="HEIGHT:50em"
runat="server">[Your
browser does <em>not</em> support <code>iframe</code>, or has been
configured
not to display inline frames.] </iframe>
</div>
VB:
Dim inData() As Byte = System.Text.Encoding.ASCII.GetBytes("SMIflood-" &
Loanid)Dim outData() As Byte = New
System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(inData)
Dim sb As New System.Text.StringBuilder(32)
Dim b As Byte
For Each b In outData
sb.Append(b.ToString("X2"))
Next
Dim pdfTempPath As String = Server.MapPath("./TempFiles/" & sb.ToString &
".pdf")
Dim ios As IO.FileStream = IO.File.Create(pdfTempPath)
Dim pdfBytes() As Byte = GetRawImage(LoanID)
ios.Write(pdfBytes, 0, pdfBytes.Length)
ios.Close()
divPDF.Style("VISIBILITY") = "Visible"
ifPDF.Attributes("SRC") = "TempFiles/" & sb.ToString & ".pdf"
John Timney ( MVP ) said:
Technically an iframe is another window, only one that can be embedded into
a web page, hence your form can be at the top of the page with your PDF
displayed below it. Your iframe should be requesting the PDF (asp.net page)
and it should load in the iframe. Probably worth your while pasting a code
sample here.
--
Regards
John Timney
Microsoft MVP
Hi John,
Using an iFrame still opens the PDF in another window. What am I missing?
Thank you.
- Cheryl
Your only choice is to use an iframe to hold the PDF
--
Regards
John Timney
Microsoft MVP
I'd like to display a web form at the top of an ASP.NET page and a PDF
from
a SQL Server database directly below the web form.
Currently, I'm getting a PDF stored in the database and using
BinaryWrite
to display just the PDF.
I'm using ASP 1.1 and VB.NET.
- Cheryl