Click here to Skip to main content
15,888,000 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to embed a pdf file in a website on a linkbutton click

I do it in following way using IFRAME and worked

C#
public void file1(string path)
   {
       string source = "http://docs.google.com/gview?url=http://intranet.divoli.in/QmsFiles/DAP/" + path + "&embedded=true";
       IFrame1.Attributes["src"] = source;

   }


But the problem is its needs the file to be stored in the same path where we put the website,

I want to show files from another directory. so i created virtual directory and tried with localhost,but not working.

i want to do is

http://localhost:81/DIV/IFDIV1100192.pdf[^]
Here DIV is the virtual directory

But its not showing file,displaying file not found message.




Please help me.

Thanks in Advance.
Posted
Updated 4-Jul-11 21:29pm
v2

Your URL is useless to us, it's on your local machine.

You have to do it in an iframe, no matter what. There's no reason your iframe can't point to any where on any web server you like. You don't need to use google, it will open if Acrobat is installed.
 
Share this answer
 
First make sure the path actually exists and that the PDF file actually lays inside.

Besides,
as I see it, best way to embed PDFs in your web site is using Scribed.
IPaper (by scribed) could make your life easier. the only problem here is all files are hosted on scribed servers (which basically saves you some space and bandwidth :))

Hope it helped (and vote if it did :))
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900