Help please: about PDF file display.

G

Guest

Hello, friends,

We have PDF files need to be displayed in web pages. My customer prefer both
PDF viewer and our own web page contents in the same IE window, rather than 2
IE windows (one to show PDF and one to show our own web contents).

Can we do this? Any sample source code or reference papers? Thanks a lot.

(I know how to make PDF viewer full of an IE window without other elements)
 
J

John Horst

Yup... Use <iframe src="..."></iframe> to show the PDF. You can point
the <iframe> right to the PDF file (via the src attribute), or point the
iframe to an aspx page and do this:

Page_Load(<<args...>>)
{
if (!this.IsPostBack)
{
Response.ClearContents();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile("filename.pdf");
Response.Flush()
Response.Close()
}
}

John
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top