I have a help button on my form when the user clicks it initializes the Help.cs form which has axAcroPDF1 initialized. Everything works as expected but when I build the application and move the release folder to a USB to copy it over to another location it can't read the pdf which is the right thing to do, how can I fix this issue so it takes the file path of the pdf from the current location.
This is my code to initialize the pdf and how I am loading it:
private void Help_Load(object sender, EventArgs e)
{
InitializeAdobe("C:\\Users\\username\\Documents\\Visual Studio 2013\\Projects\\Learning Windows Forms\\TotalReporting\\TotalReporting\\bin\\Release\\Total Reporting Help Guide.pdf");
}
private void InitializeAdobe(string filePath)
{
try
{
this.axAcroPDF1.LoadFile(filePath);
this.axAcroPDF1.src = filePath;
this.axAcroPDF1.setShowToolbar(false);
this.axAcroPDF1.setView("FitH");
this.axAcroPDF1.setLayoutMode("SinglePage");
this.axAcroPDF1.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
private void Help_FormClosed(object sender, FormClosedEventArgs e)
{
this.axAcroPDF1.Dispose();
this.axAcroPDF1 = null;
}