public bool ShowPdf(string pdfFilePath)
{
if (_adobeReader == null)
{
if(!InitializeAdobeReader())
{
return false;
}
}
try
{
//http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf
_adobeReader.Hide();
// can't handle non-ascii names _adobeReader.LoadFile(path);
_adobeReader.src = pdfFilePath;
_adobeReader.setShowToolbar(false);
_adobeReader.setView("Fit");
_adobeReader.Show();
_problemLabel.Visible = _problemPicture.Visible = false;
Enabled = true;
return true;
}
catch (Exception e)
{
_adobeReader.Hide();
_problemLabel.Text = LocalizationManager.GetString("PublishTab.AdobeReaderControl.ProblemShowingPDF", "That's strange... Adobe Reader gave an error when trying to show that PDF. You can still try saving the PDF Book.");
_problemLabel.Visible = _problemPicture.Visible = true;
Enabled = false;
return false;
}
}