Show PDF file in program

  • Thread starter Thread starter Feldaspar
  • Start date Start date
F

Feldaspar

Hi,

I have included a PDF file in my project, when the user clicks a button
I want that file to display, is this simple? How can I go about this?

Thank you
 
Hi,

Create a Form, place a WebBrowser control on that form, then call that
browser's "Navigate" method with the PDF file as a target.

The other way is to launch Adobe Reader as a process:

ProcessStartInfo psi = new ProcessStartInfo();

psi.FileName = "FileName.pdf";

Process proc = new Process();

proc.StartInfo = psi;

try

{

proc.Start();

}

catch( Exception exp )

{

MessageBox.Show( this, "FileName.pdf: " + exp.Message, "Exception",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation );

}
 

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

Back
Top