.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

PDF Reader Control

Posted By: Ruchi     Posted Date: February 15, 2009    Points:2   Category :ASP.Net
How can i use PDF reader control in asp.net?

Responses
Author: Pankaj Mishra             
Posted Date: February 15, 2009     Points: 5   

Hi Ruchi,
Sorry not clear with your question.Do you want to open .PDF file in web browser? If yes then just you need to give path of the .PDF file and if the browser is enable and acrobat reader is install in client machine then it will open .pdf file in the browser itself.

eg

Response.Redirect(@"c:\Doc\myFIle.pdf"); // or you can give relative path

Hope i understood your question.

Author: shahin             
Posted Date: February 16, 2009     Points: 5   

hi pankaj!

but if in client machine PDF is not support then what? it 1st ask to install acrobat reader and then read it. but i don't wish that client install acrobat reader but read file. isn't browser support it?

Author: Amit Mehra             
Posted Date: February 16, 2009     Points: 5   

Hi,
You can try this code and see.

Response.ClearHeaders()

Response.ClearContent()

Response.ContentType = "application/pdf"

Response.AddHeader("content-disposition", "attachment; filename = yourPDF.pdf")

string filename = "c:\yourPDF.pdf";

Response.WriteFile(filename )



Thanks,
Amit
Please "Mark As Answer " if this post help you.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend