Open pdf documents using button in c# [Resolved]

Posted by Amulya under C# on 8/31/2013 | Points: 10 | Views : 1912 | Status : [Member] | Replies : 3
Click the button and then openFiledialog will open. Then by selecting the pdf file it will open.




Responses

Posted by: Satyapriyanayak on: 8/31/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
private void button1_Click(object sender, EventArgs e)

{
openFileDialog1.Filter = "PDF Files (*.pdf)|*.pdf";

if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
Process.Start(openFileDialog1.FileName);
}
}


If this post helps you mark it as answer
Thanks

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/31/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
the following link will help u
http://www.aspdotnet-suresh.com/2012/11/aspnet-open-pdf-file-in-web-browser.html

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/31/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
System.Diagnostics namespace has a process class to do this in a simple way assuming that you havea default reader (ex: Acrobat Reader) for PDF Files.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/9719d7ff-c5b3-499c-be1c-61771df58a7f/open-pdf-document

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response